title: WPF datagrid 'newitemplaceholderposition' is not allowed during a transaction begun by 'addnew'
body: <p>I have a tabControl on a WPF form.</p>
  <p>In one of the Tab Items I have a User Control that contains a DataGrid which has  <code>CanUserAddRows=&quot;True&quot;</code>. The user can type data in the column and when they press [enter], a new row is created.</p>
  <p>The problem is when I type data into the new row and then change tabs I get this exception: &quot;WPF datagrid 'newitemplaceholderposition' is not allowed during a transaction begun by 'Addnew' &quot;</p>
  <p>Any suggestions how to avoid it?</p>
  <p>I have tried to put <code>dg.CommitEdit()</code> on <code>usercontrol.Unloaded()</code>.  I don't get the exception, but I also don't get the new row.</p>