问题
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