[SOLVED] DBGrids and DBLookupComboBoxes lazarus / 16-Databases ---------------------------------------------------------------------- guest48180 · 2019-09-28 09:41 I use a DBLookupComboBox in a DBGrid. And taking that step has caused me nothing but headaches! I can't make a selection from the DBLookup and make it stick to the cell. And I can't add to the DBLookup either. I've messed with this for three days and I'm no closer now than I was when I started. I found a couple Delphi tuts on youtube, but they were useless. And searching for info online is a waste of time. I've tried OnColExit with no luck. I also tried OnEditingDone with no luck. I cant figure out when/where I need to pass off the DBLookup's text to the column cell. I just don't get it. I'd rather slide down a pole of razorblades and land in a pool of alcohol as come here and ask for help, but this dbgrid/dblookupcombobox sorcery is beyond me. ---------------------------------------------------------------------- tonyw · 2019-09-28 11:05 If you are using IBX, then the TIBDynamicGrid component (TDBGrid descendent) has this as a built in capability. You can see how it is done in the "employee" example: look at the column properties for the "JOB_COUNTRY" field. The DBLookupProperties include a ListSource and ListField just as you would in a TDBLookupComboBox. The IBX User Guide includes more information. If you are not using IBX, then you can always look at the source code to see how it's done. ---------------------------------------------------------------------- guest48180 · 2019-09-28 11:18 I don't use IBX, and I can't find the example you mentioned. I thought it'd be in the examples folder, but I don't see it there. ---------------------------------------------------------------------- wp · 2019-09-28 11:45 Why do you stuff the lookup into the grid? Lookup of data values from another table is solved in a more general way by using lookup fields. Create a persistent field lookup field. Using a lookup field in a DBGrid column automatically applies a lookup combobox. These links are for Delphi, but Lazarus should work in the same way: http://docwiki.embarcadero.com/RADStudio/Rio/en/Defining_a_Lookup_Fiel d. This automatically displays a lookup combobox in the grid. https://www.tek-tips.com/faqs.cfm?fid=1213 ---------------------------------------------------------------------- guest48180 · 2019-09-28 12:00 Quote from: wp on September 28, 2019, 01:45:47 pmWhy do you stuff the lookup into the grid? Because all I've found has taught me to do what you see in the zip file. Not to mention that's where I need it. And several more. Also some checkboxes. I'm trying, man, even if it's wrong. And on that note, I appreciate the links and will do my best with them. Thank you very much for helping me.