combobox two value

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33249
    ronel11
    Participant

    hi to all. I want to store two values in combobox, like in html. the first value is what the users can see and the second value is the hidden value which i want to put in the database. for example I have a database table named person with
    ID, NAME field. yes i can put the list of name in a combobox but all i want is if the users select a name from list its value is the id which i want to put in the other table.. pls help. thank you……………..

    #40588
    Support
    Keymaster

    Hi
    It's not implemented in ComboBox. I think you can organize it in the program by making an array with hidden values or you can use LookupComboBox…

    #40748
    Iruau
    Participant

    See the documentation for AddObject method.
    You will have to reinterpret_cast (this is C++, sorry I don't know the equivalent in Delphi) the TObject* pointer into your datatype.

    If the value you need to store is <= 32 bits then all is fine, otherwise you will have to manage dynamic (de)allocation (in which case it may be easier to maintain a separate array like Sergei explained).

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.