TreeView collapses when SortDescription is added
Hi group.
I have a TreeView which DataContext is bound to a CollectionViewSource.
As I press a Button, I want to enable sorting on the TreeView, thus in the eventhandler I add a SortDescription like this:
myCollectionViewSource.SortDescriptions.Add(newSortDescription("Category",ListSortDirection.Ascending));
But as this happens the TreeView is collapsed. I want it to maintain it's state... maybe by forcing the expanded TreeViewItems (who are now collapsed) to be expanded again, if that's nessesary?
Any ideas?
Thanks.

