Hi;
I'm trying to understand the gird's updateMode property. If I set the property to OnRowChange, I figured the underlying datasource, in this case an ADO.NET datatable, would be updated only when a different row in the grid is selected.
So I set up an event handler for my datatable,
_dsNorthwindEmployees.Tables["Employees"].ColumnChanging += new DataColumnChangeEventHandler(DataTableColChanging);
only to find that the DataTableColChanging(object sender, DataColumnChangeEventArgs e) method fires even when I click in another cell in the same row. I was expecting to see this fire only when I clicked on another row entirely.
What am I not understanding?
Thanks,
Bill
Bill,
What I think might be happening here is that the grid is assigning the value to the underlying DataSource, but isn't actually telling the underlying row to commit the edit process. Basically, in the case where the underlying data source implements IEditableObject, the grid will call BeginEdit on the row, which tells that row that we're in an atomic edit operation. When you update cell values in the same row, they will be committed to the underlying row, but EndEdit will not actually be called until you shift focus to another row; EndEdit is what tells the underlying object to commit any changes that we've made since calling BeginEdit.
-Matt
Thanks, Mike;
You've taught me more about ADO.NET.