Home Forums WinForms controls Xceed Grid for WinForms How to cancel a row change

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16570 |

    Hi,

    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.

    thanx

    Imported from legacy forums. Posted by kozu (had 668 views)

    User (Old forums)
    Member
    Post count: 23064

    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 :

    http://doc.xceedsoft.com/products/XceedGrid/Validating.html

    Imported from legacy forums. Posted by André (had 966 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.