By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,286 Members | 1,634 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,286 IT Pros & Developers. It's quick & easy.

Combobox Data/Value Member Question

P: n/a
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..

--
Kevin
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

"ksedran" <ks*****@discussions.microsoft.com>
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..

--
Kevin

Nov 21 '05 #2

P: n/a
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

"ksedran" <ks*****@discussions.microsoft.com>
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..

--
Kevin

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.