title: How to get a WPF DataGrid to resort when a value changed?
body: <p>I have a <code>DataGrid</code> control in a C#, WPF Project.</p>
  
  <p>The control sorts by a column so far so good, however when a value changes and emits <code>PropertyChanged</code> this does not make the DataGrid resort.</p>
  
  <p>i.e. it only sorts when the column header is clicked but ignores all subsequent value changes and with time the list becomes disorganized until the user again clicks the column header.</p>
  
  <p>a ugly workaround would be this:</p>
  
  <pre><code>if (sockGrid.Items.SortDescriptions.Count &gt; 0)
  {
      sockGrid.Items.SortDescriptions.Insert(0, sockGrid.Items.SortDescriptions.First());
      sockGrid.Items.SortDescriptions.RemoveAt(0);
  }
  </code></pre>
  
  <p>But there must be a better way that would hopefully have also a much better performance?</p>
  
  <p>So my question is: how can I get the <code>DataGrid</code> to auto-update the sorting when one of the listed items emitted a <code>PropertyChanged</code> event?</p>