Jump to content

DBLookupCombox editor in dbgrid


alesf76

Recommended Posts

I was not able to found an example for a very common case like this:

- DataSet1 is an invoice list with a CUSTOMER_ID field

- DataSet2 is the curstomer list with an ID field and a DESCRIPTION field

 

I would like to have a dbgrid to edit DataSet1, where the CUSTOMER_ID column is displayed with the DESCRIPTION field looked up from dataset2, and the editor is a dblookupcombobox  showing the descriptions from DataSet2 but saving the ID in the CUSTOMER_ID field.

 

Could anyone point me to the right direction ?

Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

eustachio, I have the same problem.... in the demo you mention KeyField=country and ListField=country. Let me try to explai what the original poster and myself want

Table1: InvoiceNo:INTEGER(11), CustID:INTEGER(11) - Data (111,1) (222,2) (333,3) (444,1)

Table2: ID:INTEGER(11), Customer:CHARACTER(4) - Data (1,'John') (2,'Bill') (3,'Jane') (4,'Mary')

The grid should show

111   John

222   Bill

333   Jane

444    John

When we click on 'Bill' we should get a combo listing John/Bill/Jane/Mary. If we select Mary the second row in Table1 should become (222,4).

How is this achieved?

 

 

 

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...