taha_gh Posted May 15, 2014 Posted May 15, 2014 hi all can i change the key for edit in unidbgrid (by default enter) to for exemple F2 or other Quote
Sherzod Posted May 16, 2014 Posted May 16, 2014 Hi Taha Try: This code not cancels pressing Enter Simply adds the F2 key to enter the cell procedure TMainForm.UniDBGrid1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); var gridJSName: string; begin if Key = VK_F2 then begin gridJSName := (Sender as TUniDBGrid).JSName; UniSession.AddJS(gridJSName + '.editingPlugin.startEditByPosition({row: ' + gridJSName + '.uniRow, column: ' + gridJSName + '.uniCol})'); end; end; Best regards. Quote
Sherzod Posted May 16, 2014 Posted May 16, 2014 This code cancels pressing Enter, but it is not the best way ...: UniDBGrid1 -> ClientEvents -> ExtEvents -> add and replace function keydown: function keydown(e) { if (e.keyCode == 13 && this.editingPlugin) { this.editingPlugin.completeEdit(); } } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.