Combobox Data/Value Member Question

G

Guest

Hello,

I have a combobox in a winform set up with the following code:

da = New OracleDataAdapter("select curr_code || '=' || desc As curr_desc,
curr_code from tablename", Conn)

da.Fill(ds, "currency_code")
cb_currcode.DataSource = ds.Tables("currency_code")
cb_currcode.DisplayMember = "CURR_DESC"
cb_currcode.ValueMember = "CURR_CODE"

An example of an item in the combobox would look like this
134 = United States.

When the user clicks the combobox and the list drops, I would like the list
to contain the full description - '134 = United States.'

But when the user selects an item, and the list retracts, I would like th
box to just display the 134.

Is this possible?
If so, any hints to get me going in the right direction?

Thanks experts..
 
C

Cor Ligthert

ksedran,

For me it seems that nothing is impossible in DotNet, however you will have
to make it yourself using (inherriting) the combobox. While that is not the
most simple and bugless control there is. So know what you do when you start
with it.

Standard it is not possible, the displayed text is the textbox is the item
or the displaymember (with a datasource).

I hope this gives some idea's

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top