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!
Hello Khaled,
Thank you for sharing your solution with the community.
Feel free to contact me if you have any other questions.
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; }
}