DataGridComboBoxColumn & SortMemberPath

Sep 9, 2009 at 12:50 AM

Hello,

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}"
                                               DisplayMemberPath="code"
                                               SortMemberPath="code"
                                               CanUserSort="True"
                                               
                                               />

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 11:38 AM

Hello,

Try this: SortMemberPath="Material.code". 

Kirsten