DBLookUpCombo in a DBGrid lazarus / 16-Databases ---------------------------------------------------------------------- DeBritto · 2015-12-11 12:05 Hi everybody, Is it possible to put a DBLookupCombo in a DbGrid? How to do it? Best regards ---------------------------------------------------------------------- mangakissa · 2015-12-12 10:58 I know there's an example in lazarus Wiki, but can't find it. But this helps. ---------------------------------------------------------------------- goodname · 2015-12-12 15:58 The following works. Code: [Select]procedure TForm.DBGrid1SelectEditor(Sender: TObject; Column: TColumn;  var Editor: TWinControl); begin  if DBLookUpCombo.ListField=Column.FieldName then begin   DBLookUpCombo.BoundsRect:=DBGrid1.SelectedFieldRect;   Editor:=DBLookUpCombo;   DBLookUpCombo.Visible:=true;  end; end; ---------------------------------------------------------------------- DeBritto · 2015-12-15 23:04 Thank you so much goodname and mangakissa! I have tried the solution proposed by good name. In principle works like a charm, but I still struggling with one problem. I need to show the "ListField" field in the Grid instead of Keyfield" but as the ListField is in another table I had to create the DBGrid upon a nested Select (since with joined select I canot update the fields...). At this point I can show all the fields correctly at the DBGrid, but when I try to update the database I get errors... Do you have some ideas? ---------------------------------------------------------------------- mangakissa · 2015-12-16 08:07 Use UpdateSQL to update a record of your dataset. ---------------------------------------------------------------------- goodname · 2015-12-16 18:29 The UpdateSQL should work. There are TSQLQuery lookup fields that I think would do the job as well. Similar set up in many ways to calculated fields. I'm sure there is something on the wiki about them. Actually the following might be a better solution then what I came up with. http://forum.lazarus.freepascal.org/index.php/topic,29611.msg187257.ht ml#msg187257