I use the BeforeCellKeydown event in ClientEvents.Ext Events :
beforecellkeydown=function beforecellkeydown(sender, td, cellIndex, record, tr, rowIndex, e, eOpts)
{
var key = e.getKey();
ajaxRequest(this, "BeforeCellKeyDown", ["keycode="+key], false);
return true;
}
Then on the UniDBGRid1.OnAjaxEvent :
procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string;
Params: TUniStrings);
var
lKey: Integer;
begin
if EventName = 'BeforeCellKeyDown' then
begin
lKey := Params['keycode'].AsInteger;
UniMemo1.Lines.Add(IntToStr(lKey));
end;
end;
When you are editing a cell, the key pressed is displayed in the memo to the right of the grid. For example, if I press the "A" key, the number 65 is displayed in the memo. If I press the "Tab" key, the number 9 is displayed in the memo. But I can't display the number of the "Return" key in the memo. It also doesn't work with the "Escape" key.