DataGridComboBoxColumn & SortMemberPath

Sep 9, 2009 at 1:50 AM


After setting the SortMemberPath property of my datagridcomboboxcolumn, I could be able to sort by clicking on the column header, but it worked only on the first click. All the other ones do not make any effect. My columns is defined as:

 <my:DataGridComboBoxColumn Header="{LocText Assembly=OtimizeStandard, Dict=Resources, Key=CODE}"
                                               ItemsSource="{Binding Source={StaticResource MaterialLookupSource}}"
                                               SelectedItemBinding="{Binding Path=Material}"

My ItemsSource is a local usercontrol resource of type CollectionViewSource. This collection viewsource is populated in code-behind when the application is loaded and its source property is bound to an ObservableCollection derived class.

What can I do to make the sorting work?

Thanks in advance,

Igor Kondrasovas.


Oct 20, 2010 at 12:38 PM


Try this: SortMemberPath="Material.code".