WPF Toolkit Datagrid and ListViewCollection SortDescriptors

362 Views Asked by At

I have a weird problem with datagrid. I have a list with 2 items, inside every item there is a ListCollectionView.

A datagrid is binded to the selected item's ListCollectionView.

if I add (in code) a sort description to the selected item's ListCollectionView ,select item 2 and then select item 1 again the ListCollectionView sortDescription is "gone"

any ideas?

1

There are 1 best solutions below

0
On BEST ANSWER

I still dont know why that happens but the workaround is to keep the sorting descriptions in a dicationary and register to the grid layouting finished event and then restore the descriptors to the grid.