RadComboBox Items Sorting with RadComboBoxSort.None

谁都会走 提交于 2019-12-12 21:03:17

问题


What happens to RadComboBox's Items after you call:

myCombo.Sort = RadComboBoxSort.None;
myCombo.Items.Sort();

???

Even when sort option is set to None, Items are sorted, but it is not sorted neither by Text nor Value. An items are ordered by random pattern which make no sense.


回答1:


Use SortItems() method instead of Items.Sort().

Documentation says that these approaches are equal:

RadComboBox1.SortItems();
RadComboBox1.Items.Sort(); 

That is not exactly true. If Sort property is set to None, SortItems leaves items unsorted, but Items.Sort will do something unexpected.



来源:https://stackoverflow.com/questions/7345935/radcombobox-items-sorting-with-radcomboboxsort-none

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!