Is there a way to cancel a row change? I have a gird with items, and when the user clicks from item to item I’m trying to save the data for the item losing the selection. If the save fails for some reason I want the selection to stay put.
Imported from legacy forums. Posted by kozu (had 668 views)
You can use the validation feature offered by the grid to do this. You can do it at the cell or the row level.
For example, at row level, in the EndingEdit event, validate the values in each cell, and if some values do not pass the validation process, set the CancelEventArgs.Cancel to true. This will raise the validation event, in which you can set the RowValidationErrorEventArgs.CancelEdit to false, which will prevent the row form leaving edition. If you set it to true, the row will leave the edit mode, but cell values will revert back to what they were before editing.
Here is more information from our help documentation :