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
440
Use ESC Key to discard changes
posted

Hi,

I'd like to be able to use the ESC Key to discard any changes in a cell. I generate my columns dynamically and they get assigned the default grid editors.

The desired behavior is if I begin to edit a cell, and no longer want the changes, to hit the ESC key and the value in the cell will revert to the old one.

Thanks!

Parents
  • 440
    Verified Answer
    posted

    Found the answer:

    function WebDataGrid1_ExitedEditMode(sender, eventArgs) {

                if (eventArgs.get_browserEvent().keyCode == 27) {   // if esc key was hit, exit without saving

                    var editingBehavior = grid.get_behaviors().get_editingCore().get_behaviors().get_cellEditing();
                    editingBehavior.exitEditMode(false);

                    return;
                }

    }

Reply Children
No Data