Update datagrid row that is in edit state to source from code
<p>I have a Datagrid with <code>SelectionUnit="CellOrRowHeader"</code> set.</p>

<p>With my DataGrid being in the content area of a TabControl, the currently edited row is being discarded when I switch the tab.</p>

<p>I figured when I get the <code>DataRowView</code> of the current row, I can call <code>row?.EndEdit();</code> (which is being triggered by a enter hit on the keyboard, but can also be called manually) to update the data to source. However, I cant seem to get the current <code>DatarRowView</code>.</p>

<p>How could I tell the DataGrid to update all the currently edited data to source? Is my approach the correct one, and if yes, how do I get the current <code>DataRowView</code>?</p>

<p>If not, how do I tell the DataGrid to finish edit mode and update its new data to source?</p>