title: WPF Datagrid: Clear column sorting
body: <p>I am using a WPF Datagrid in my application where columns can be sorted by clicking on the header.</p>
  
  <p>I was wondering if there was any way to clear a column's sorting programatically ?</p>
  
  <p>I tried sorting a column and then clearing <code>MyDataGrid.Items.SortDescriptions</code>, but that collection was empty (even though one column was sorted).</p>
  
  <p>I also tried :</p>
  
  <pre><code>MyDataGridColumn.SortDirection = null;
  </code></pre>
  
  <p>The problem is that the column indication is gone, but the sorting still occurs when editing a cell and switching rows.</p>
  
  <p>Is there no way to clear a column's sort ?</p>
  
  <p>Edit (for clarity): The problem is that I'd like to allow sorting again if the user re-clicks on the same column header, so setting CanUserSort to false would be problematic, even if it were done in the XAML. In short, what I'm attempting to do, is prevent rows from being ordered once a sorted column has a cell that was modified. I want to force the user to re-click on the header.</p>