KingOrmon Posted November 23, 2021 Share Posted November 23, 2021 Hi, Simply, how can I detect if TUniDBGrid is in edit mode ? I need to detect if a cell of a grid is on edit, the idea is if I can type in this cell or no. Thank you Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 23, 2021 Share Posted November 23, 2021 Hello, 49 minutes ago, KingOrmon said: Simply, how can I detect if TUniDBGrid is in edit mode ? I need to detect if a cell of a grid is on edit, the idea is if I can type in this cell or no. Could you please clarify your question? Quote Link to comment Share on other sites More sharing options...
KingOrmon Posted November 23, 2021 Author Share Posted November 23, 2021 See the image attached for see the states of grid colunm Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 23, 2021 Share Posted November 23, 2021 14 minutes ago, KingOrmon said: See the image attached for see the states of grid colunm Okay, but where do you want to check the edit mode? Quote Link to comment Share on other sites More sharing options...
KingOrmon Posted November 23, 2021 Author Share Posted November 23, 2021 In delphi code, I need to know if is cell prepared for typing (edit) or not Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 23, 2021 Share Posted November 23, 2021 13 minutes ago, KingOrmon said: In delphi code, I need to know if is cell prepared for typing (edit) or not Your case is not very clear to me, perhaps you need two client-side events: beforeedit and edit. Quote Link to comment Share on other sites More sharing options...
KingOrmon Posted November 23, 2021 Author Share Posted November 23, 2021 The problem that I have is on event UniDBGrid KeyDown, it is triggered always even when a Column Editor is typing. I don´t know if it is a normal behaviour or changed from last versions. Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted November 24, 2021 Share Posted November 24, 2021 Hello, Why don't use state ? If MyDataSet.State in [dsEdit, dsInsert]) then Quote Link to comment Share on other sites More sharing options...
KingOrmon Posted November 24, 2021 Author Share Posted November 24, 2021 Hi, because DataSet.State is always in dsEdit in my case Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 24, 2021 Share Posted November 24, 2021 On 11/23/2021 at 2:45 PM, KingOrmon said: The problem that I have is on event UniDBGrid KeyDown, it is triggered always even when a Column Editor is typing. Hello, Describe this cycle of the process again, what you wanted to do. Quote Link to comment Share on other sites More sharing options...
KingOrmon Posted November 24, 2021 Author Share Posted November 24, 2021 Hi, The main problem is that typing in a editor column (like UniLookCombo) all key down events are triggered to UniDBGrid, and it generates problems if you are monitoring this keys for other actions. Example: if you press key_down for select an item of edit (UniLookCombo) it triggers VK_Down of UniDBGrid. And I think that it is not correct Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 24, 2021 Share Posted November 24, 2021 Ok I will try to analyze. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 24, 2021 Share Posted November 24, 2021 52 minutes ago, KingOrmon said: The main problem is that typing in a editor column (like UniLookCombo) all key down events are triggered to UniDBGrid, and it generates problems if you are monitoring this keys for other actions. Can you try this approach? function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { columns.forEach(function(col) { if (col.getEditor()) { col.getEditor().addListener('keydown', function(field, e) { e.stopPropagation() }) } }); } 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.