Jump to content
Ian Branch

TDBComboBox in reverse..

Recommended Posts

Hi Team,

TDBCombobox may not be the right component to use here...

At data input time in a separate App I have a TComboBox that has its index value saved to a field.

The TComboBox has 5 options, therefore 0 - 4 is saved in the field.

 

I now want to go in reverse and based on the field value show the relevant option.

If I use TDBComboBox all I see is 0 - 4.

Is there something I can do with TDBComboBox to achieve what I want or do I need to use a different component?

 

Regards & TIA,

Ian

Share this post


Link to post

Create handlers for the DB fields OnGetText and OnSetText events and do the conversion inside. Note that the DBComboBox Items property still needs the list of valid text entries to select from.

Share this post


Link to post

Tks Uwe,

I figured the Items needed to be there, I just wasn't sure how to make them appear for their relevant field value.

 

Ian

Share this post


Link to post

TDBComBox without items amazed me too. If you have TMS, use it.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×