M477H13U Posted July 20, 2018 Share Posted July 20, 2018 Hello UniGUI users !! I would like to know if it is possible to change the behavior of escape shortCut while inserting a new row in a grid. Actually, the behavior is as fallow: you're editing the newly inserted row. Press escape button the whole line is deleted We would like this behavior: you're editing the newly inserted row. Press escape button once current cell's value is reset Press escape button a second time. The whole line is deleted. How could we achieve something like that ? Regards, Quote Link to comment Share on other sites More sharing options...
M477H13U Posted August 6, 2018 Author Share Posted August 6, 2018 Up ! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 6, 2018 Share Posted August 6, 2018 Hi, Hello UniGUI users !! I would like to know if it is possible to change the behavior of escape shortCut while inserting a new row in a grid. Actually, the behavior is as fallow: you're editing the newly inserted row. Press escape button the whole line is deleted We would like this behavior: you're editing the newly inserted row. Press escape button once current cell's value is reset Press escape button a second time. The whole line is deleted. How could we achieve something like that ? Regards, We will try to analyze this... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 7, 2018 Share Posted August 7, 2018 Can you try this solution as a "workaround" ?! 1. UniDBGrid1 -> ClientEvents -> ExtEvents -> function canceledit(editor, context, eOpts) { return false } 2. UniDBGrid1 -> ClientEvents -> ExtEvents -> function keydown(e, t, eOpts) { if (e.keyCode == 27) { ajaxRequest(this.grid, '_cancel', []); }; } 3. UniDBGrid1 -> OnAjaxEvent procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_cancel' then with (Sender as TUniDBGrid).DataSource.DataSet do if Active and (State in [dsInsert]) then Cancel; end; Quote Link to comment Share on other sites More sharing options...
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.