Recent

Author Topic: ComboBox into TDBGrid  (Read 7231 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
ComboBox into TDBGrid
« on: June 23, 2011, 11:39:50 am »
I wanted to know how is it possible if I have two tables and a t_job t_man (where there is a field that contains the identification of the work) where there are workers in t_man t_job and there are jobs available as you do TDBGrid an editable against a worker there is the possibility to choose him to do that work through a combobox in TDBGrid inserted.

An example would be appreciated

thanks
« Last Edit: June 24, 2011, 11:40:20 am by xinyiman »
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: ComboBox into TDBGrid
« Reply #1 on: June 24, 2011, 09:41:01 am »
I followed this link I just do not understand how to use the SendMessage, it gives me error, then I wanted to know if it is a cross platform solution.


http://delphi.about.com/od/usedbvcl/l/aa101403b.htm


SendMessage (DBLookupComboBox1.Handle, WM_CHAR, parola (chiave), 0);
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: ComboBox into TDBGrid
« Reply #2 on: June 24, 2011, 10:03:52 am »
Ok, it works fine. Just comment on the SendMessage as well and should be multiplatform.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: ComboBox into TDBGrid (SOLVED)
« Reply #3 on: June 24, 2011, 11:40:09 am »
Ok, now I know how to put the combobox in the DBGrid, but now there's a problem, when I abandoned the field that contains the DBGrid get the index, while I continue to show him the value selected, because the index of the sex of the person as in the attached example is not talking

Ok, the DB prova1.s3db should be placed in c:\
« Last Edit: June 24, 2011, 11:43:06 am by xinyiman »
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018