Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
400
WebGrid DataChanged property
posted

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

Parents
  • 36
    posted
    So this is still a problem for many developers wanting this common behaviour, i suppose.
    The fact that any suggestions made so far are workarounds leaves one question open nuhfeken stated:
    > Why even have DataChanged.Deleted if you can't check for it?
    My answer is because it's a bug.

    A behaviour that would make sense here was to post back ALL rows - even if they're deleted and in this case with a DataChanged status of Deleted.
    Avoiding to post the deleted rows back and forth (because they're unneeded after their actual deletion) can be handled on the server-side simply by deleting those rows.

    I'm quite surprised the incredible UltraWebGrid has a bug at such an important spot.

    Besides I wonder why there is an AddNew-button but no AddDelete-button? No user suspects the DEL-Key to work here.
    Yes, I can build my own button. But again, the user suspects it to appear next to the AddNew-button - a position that's almost out of reach.

    So my suggestion the Infragistics Team is asked her to work a bit on this section of the UltraWebGrid.
    Is see no other way to handle this issue in a clean manner.

Reply Children