title: 'DeferRefresh' is not allowed during an AddNew or EditItem transaction
body: <p>I have a tab control in the GUI and there is WPF 4.0 datagrid in one of the tabs. When I click on a cell in the grid and edit something and then switch tabs, I get a Defer Refresh error:</p>
  
  <blockquote>
    <p>DeferRefresh' is not allowed during an AddNew or EditItem transaction.</p>
  </blockquote>
  
  <p>So I call <code>datagrid.CancelEdit(DataGridEditingUnit.Row)</code> when tab is switched to cancel any pending edit and the Defer refresh issue is gone.</p>
  
  <p>But what I really want to do is <code>CommitEdit()</code> so that the user doesn't have to reenter the data again.</p>
  
  <p>And <code>datagrid.CommitEdit(DataGridEditingUnit.Row, true)</code> doesn't work for me. 
  I get the below error on <code>CommitEnd()</code>: </p>
  
  <blockquote>
    <p>Cannot perform this operation while dispatcher processing is
    suspended.</p>
  </blockquote>
  
  <p>PS: I have tried datagrid.CommitEdit() and datagrid.CommitEdit(DataGridEditingUnit.Column, true) and it didnt work.</p>