Topic: Foreign Key Drop-Down Box in Grid When Using SQL Query

Hello,

When using the program's "built-in" dialogs to populate the grid component with data, we get drop-down boxes for each cell where foreign keys are present, allowing us to select values from related tables when creating or editing records.

However, when I populate the grid using an SQL query, these drop-down boxes do not appear.

Is there a way to replicate this behavior when using the SQL Query approach?

Thank you for your time!

Re: Foreign Key Drop-Down Box in Grid When Using SQL Query

Hi


The archive contains two examples:
test - the SQL query is set manually in a script or button. The query is processed by the program.
Disadvantage - the program processes fairly simple queries, without complex joins.
test 1 - an example of creating a table manually with TnxListColumn and TnxTextColumn columns for editing.
In the future, all processing of your SQL query for display and saving changes in the table is processed by you manually.

Post's attachments

Attachment icon test.rar 9.49 kb, 46 downloads since 2025-03-06 

Re: Foreign Key Drop-Down Box in Grid When Using SQL Query

Sparrow!

Thank you so much for all the examples, they are very clear and I appreciate you for taking your time providing them, it really helps to learn - you are always a savior!