rDBGrid - empty "Key" parameter in OnKeyPress event while LookupCondition is set to “lcBrowse”

14 views
Skip to first unread message

Tomasz Okarma

unread,
Jun 18, 2025, 2:39:54 AMJun 18
to Rosi Delphi Components
I noticed a problem with the "OnKeyPress" event of the "TrDBGrid" component when "LookupCondition" is set to the value "lcBrowse".
The "KeyPress" method is called, but the "Key" parameter has an empty value. The problem disappears when I switch "LookupCondition" to "lcNever".
I need to replace comma with period while typing - for user convenience - in automatic lookup implemented in rDBGrid.

Is there any workaround for this problem?

Tomas Rosinsky

unread,
Jun 18, 2025, 1:56:55 PMJun 18
to Rosi Delphi Components
Hi,

key is used and reset by internal lookup which is called before standard KeyPress procedure which calls OnKeyPress.

Possible solution is quite easy, edit rDBGrid.pas file, find implementation of
procedure TrDBGrid.KeyPress(var Key: char);

and move 
inherited KeyPress(Key); 

before code for lookup of field value (to line 11484 in last version).

I will check it and probably update for next version.

Thanks and regards
Tomas


Dne středa 18. června 2025 v 8:39:54 UTC+2 uživatel okarma...@gmail.com napsal:

Tomasz Okarma

unread,
Jun 23, 2025, 3:40:27 PMJun 23
to Rosi Delphi Components

Thank you very much for the hint. Your solution worked. I would appreciate if you would include the mentioned modification in the next version. 

Greetings from Cracow

Tomasz

Reply all
Reply to author
Forward
0 new messages