How to limit the input in the rdbgrid cell only to the values of the associated picklist.
24 views
Skip to first unread message
Giuseppe Borgobello
unread,
Dec 6, 2024, 6:14:18 AM12/6/24
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Rosi Delphi Components
Hello everyone, I would like to limit the input in a cell (column) of an rdbgrid to only the values present in its picklist, without the user being able to modify the cell with the keyboard. Is there a way to achieve this? Thanks Giuseppe
Tomas Rosinsky
unread,
Dec 8, 2024, 10:54:53 AM12/8/24
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Rosi Delphi Components
HI Giuseppe,
there are 2 possible solutions.
1/ use lookup field with list of values (key field and value field can have same values) and then only values from the list can be selected
2/ use OnKeyPress event and block editing for the field with picklist
procedure TrDBGrid2.gr2KeyPress(Sender: TObject; var Key: Char); begin if gr2.SelectedField=SomeField then Key:=#0;
end;
I hope it helps
Tomas
Dne pátek 6. prosince 2024 v 12:14:18 UTC+1 uživatel g.borg...@cracra.it napsal: