I've been unable to find specifics in the documentation for how the underlying data rows get updated when binding an editable grid to a dataTable. I have a problem where I retrieve a dataTable, call AcceptChanges() on it, bind it to the grid and the data shows properly. When the user edits row cells and clicks the save button, the RowState properties on the underlying dataTable are not set to Modified as they should be.
Is there an Update Mode property or something I'm missing? I've tried clicking elsewhere inside and outside of the grid after editing and the rowState remains unchanged. Ideas?
EDIT: The following code appears to fix it. It's called just before saving:
Is this the right way I should be handling this? Seems a little kludgy...Thx
Is there an Update Mode property or something I'm missing? I've tried clicking elsewhere inside and outside of the grid after editing and the rowState remains unchanged. Ideas?
EDIT: The following code appears to fix it. It's called just before saving:
foreach (GridViewRowInfo row in grd.MasterGridViewTemplate.Rows) |
{ |
DataRow dr = ((System.Data.DataRowView)(row.DataBoundItem)).Row; |
dr.EndEdit(); |
} |
Is this the right way I should be handling this? Seems a little kludgy...Thx