I'm attempting to use the Row.DataChanged property to control updates to our database, but I must not full understand how it works. Any suggestions would be appreciated.
We bind a dataset to a grid and display it. The user is allowed to make changes (modify, add, delete). When the user has finished, they click a Save button. The Save button server-side implementation does the actual database updates. We don't want to update the database until Save is clicked.
The Save implementation iterates over Grid.Rows looking at DataChanged for each row. This works fine for Unchanged, Added and Modified rows. However, Deleted rows are gone from Grid.Rows so we can't capture those changes. The documentation for DataChanged seems to indicate that all four row states should be possible.
What am I missing? Do Deleted rows only show up for certain types of data sources? Do Deleted rows ever show up? I'd really like to avoid caching the data to determine what was deleted, but that seems like the next step. Any other suggestions?
Thanks,
DaveL
To let you know how I got around this functionality is I ended up adding functionality to all of our grids that add a hidden column to the grids that handles the datachanged properties through javascript. This will also persist through postbacks until the grid is rebinded. It seems a bit rediculous but it was the only way to maintain datachanged properties through multiple postbacks for our grids.
My suggestion to infragistics is to maintain DataChanged properties until the grids are rebinded and the user has viewstate enabled for their grid. If people do not use viewstate in their grids then they should have to implement their own version of DataChanged with some other state management implementation.