Recent

Author Topic: [solved] Save ItemIndex of DBComboBox  (Read 2085 times)

kapibara

  • Hero Member
  • *****
  • Posts: 610
[solved] Save ItemIndex of DBComboBox
« on: October 26, 2014, 02:59:33 am »
Lets say there are three choices: (small, medium, big) to choose from. I'd like to use a DBComboBox, not a DBLookupComboBox, because it feels like overkill to create a lookuptable and a ListDataSet just for that.

Whats the best solution to store the ItemIndex of the DBComboBox instead of the displayed Item string?

(DBRadioGroup seems to handle this with a Values list)
« Last Edit: October 27, 2014, 03:35:46 am by kapibara »
Lazarus trunk / fpc 3.2.2 / Kubuntu 22.04 - 64 bit

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Save ItemIndex of DBComboBox
« Reply #1 on: October 26, 2014, 04:24:07 am »
Is this all you want to do?   Why don't you use a TcomboBox and handle the read writes  youself.
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

kapibara

  • Hero Member
  • *****
  • Posts: 610
Re: Save ItemIndex of DBComboBox
« Reply #2 on: October 27, 2014, 03:35:23 am »
Thanks Mike, thats a solution.

[Edit]
Later I discovered that the RXLib trunk version for Lazarus has a DBComboBox that does exactly whats needed. That pack has a multitude of other components too.

Is this all you want to do?   Why don't you use a TcomboBox and handle the read writes  youself.
Lazarus trunk / fpc 3.2.2 / Kubuntu 22.04 - 64 bit

 

TinyPortal © 2005-2018