title: wpf set sorting programmatically, so that the header is toggled as sorted
body: <p>I have a problem with a wpf toolkit <code>DataGrid</code>.</p>
  
  <p>I have an <code>ItemsSource</code> with three columns:</p>
  
  <p>FirstName</p>
  
  <p>LastName</p>
  
  <p>Address</p>
  
  <p>In the C# codebehind I set the sort direction and which column to sort on like this:</p>
  
  <pre><code>ICollectionView view = CollectionViewSource.GetDefaultView(dataGrid1.ItemsSource);
  view.SortDescriptions.Clear();
  view.SortDescriptions.Add(new SortDescription("LastName", ListSortDirection.Ascending));
  view.Refresh();
  </code></pre>
  
  <p>There is no problem in the actual sorting but there is in the headers visual style. If the user sorts a column by clicking on the header, the visual style changes, but the visual style does not indicate that the column sort description is set programmatically. </p>
  
  <p>Why is this, and how can I toggle the header so it will show up as sorted?</p>