Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top