I have a problem in wpf toolkit datagrid.
I have a Itemsource whit three columns: FirstName LastName Address
in C# Codebehind i set the sort direction and wich column to sort on like this:
ICollectionView view = CollectionViewSource.GetDefaultView(dataGrid1.ItemsSource);
view.SortDescriptions.Clear();
view.SortDescriptions.Add(new SortDescription("LastName", ListSortDirection.Ascending));
view.Refresh();
There is no problem in the actual sorting but in the headers visual style. If the user sort a column by clicking on the header, the visual style changes, but this will not happen if the column sort description is set programatically.
Why is this, and how can i toggle the header so it will show as it was clicked?