The UltraGrid has a handy function of "undoing" changes - that is, if you make a change two a few fields, and hit escape a few times (before you leave the row), it will "Undo" the changes you just made. For the most part, this is a very handy feature. There are some circumstance, however, where I want to forget any changes past a previous point.
In certain forms, when a user modifies a certain field, I save/insert the record. At this point (when I save the record/row), I dont want the user to be able to undo any changes that were made to this record/row before the save.
How can I do this? Make the gridrow forget the changes up until now?
Thanks.
It sounds to me like you don't want the grid to forget the changes, you want the grid to commit the changes. You can do this by calling UpdateData on the grid. This will force the grid to write all pending change to the underlying data source.
If you want to disable the Escape key functionality, you would have to use the grid's KeyActionMappings and remove the actions from the list.
Thanks - your first suggestion (UpdateData) does exactly what I was after.
Hi, all.
I have found another solution. Use BeforeRowCancelUpdate event for UltraGrid and set e.Cancel = true;
Alex.