سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top