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
608
How to cancel editing a cell? Missing event property
posted

Hello,
in my WebDataGrid I want to let the user add new records. The first column is the key column and the values entered into this field have to be unique. So I wanted to use the CellEditing_ExitedEditMode event.

Here I want to validate the entered value and if the entered value is already in that grid I tried to use "eventArgs.set_cancel(true)". I know this property is available in eventArgs of the CellEditing_EnteringEditMode event and also the method to set that value.

see screenshot2

Unfortunately a similar property and the method are not available in the CellEditing_ExitedEditMode as you can see in screenshot 2

Why is that property and method not available? Has this a special reason? If I can prohibit editing a cell I think it should also be possible to cancel editing. How can I do that now?

Parents
No Data
Reply
  • 33839
    Suggested Answer
    posted

    Hi martinn,

    It turns out you're correct that this behavior does exist, but you are just using the wrong event.  We have four events four editing: entering, entered, exiting, and exited.  The -ed events happen after the cell has already entered or exited edit mode.  It really is just a notification.  In order to cancel the event, you need to handle the -ing events.  The method on the event args will be available in the exitingEditMode event.  Let us know if you need any other help.

    regards,
    David Young 

Children