Hey,
I have a BindingList attached to the ItemsSource of a xamComboEditor, but the items seem to be unsorted in the dropdownlist. Is there any way to sort the items of the dropdownlist by the displaymember (which is a string)? I have tried to use the following code but without success.
XAML:
<i
<igEditors:XamComboEditor.ItemsProvider>
<igEditors:ComboBoxItemsProvider x:Name="itemsProvider1"/>
</igEditors:XamComboEditor.ItemsProvider>
</igEditors:XamComboEditor>
CODE:
System.ComponentModel.
SortDescription SD = new System.ComponentModel.SortDescription();
SD.Direction = System.ComponentModel.
ListSortDirection.Ascending;
SD.PropertyName =
xamComboEditorSample.ItemsProvider.ValuePath =
xamComboEditorSample.ItemsProvider.DisplayMemberPath = "nameFull";
xamComboEditorSample.ItemsProvider.Items.SortDescriptions.Add(SD);
xamComboEditorSample.ItemsProvider.ItemsSource = list; //List is here a bindinglist
Hello ,
One possible solution is to sort the list before populating the ItemsSource :
IEnumerable<Person> query = items.OrderBy(i => i.nameFull);
xamComboEditorSample.ItemsProvider.ItemsSource = query;
Hope this helps
Vlad
Developer Support Team