I have a Datagrid with SelectionUnit="CellOrRowHeader"
set.
With my DataGrid being in the content area of a TabControl, the currently edited row is being discarded when I switch the tab.
I figured when I get the DataRowView
of the current row, I can call row?.EndEdit();
(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 DatarRowView
.
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 DataRowView
?
If not, how do I tell the DataGrid to finish edit mode and update its new data to source?