I have a RadGrid, on which I enabled the Edit mode. When I hit the edit icon a column from the grid can be edited (see the attached Grid2.png). At this point I want to edit the text and confirm with ENTER. On hitting ENTER I want to prevent the form submission and fire the grid update command. Unfortunately the submission prevention doesn't work, the grid update command is fired. Here is what I tried:
function OnGridKeyPressed(sender, eventArgs) {
if (eventArgs.get_keyCode() === 13) {
CancelSubmission(eventArgs);
var mtv = $find(sender.ClientID).get_masterTableView();
var items = mtv.get_editItems();
if (items.length == 1) {
var idx = items[0].get_itemIndexHierarchical();
mtv.fireCommand('Update', idx);
}
}
}
function CancelSubmission(args) {
args.set_cancel(true);
return false;
}
Also this in CancelSubmission:
function CancelSubmission() {
var e = window.event;
e.cancelBubble = true;
e.returnValue = false;
if (e.stopPropagation) {
e.stopPropagation();
e.preventDefault();
}
Any help will be appreciated!
Thanks in advance
Vasil