473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Combobox Data/Value Member Question

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
2 5047
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bds | last post by:
I'm new to .net 2.0 and I'm trying to figure out the best way to create a form that has a couple of controls and one of the controls is a combo box with a data bound list of items from another...
6
by: Omar | last post by:
When I try to databind my comboBox (specifically field "emplcode") to a filled dataset , the contents of the comboBox displays a bunch of "System.Data.DataRowView". I assume the amount of times...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
5
by: jaYPee | last post by:
i have successfully added a combobox to my datagrid by setting their datasource from one of my table. here's my code... Dim grdColStyle6 As New DataGridComboBoxColumn() With grdColStyle6...
2
by: AMDRIT | last post by:
Hello Everyone, I would like to format the Display Members of a combobox's datasource. Is there a way to apply a format without subclassing the original datasource? For example, given a list of...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
4
by: c_shah | last post by:
I am a beginner and learning VB.net There are two wasy to bind a combobox or a listbox First approach is to assign a datasource and displaymember Second approach is to iterate through datarow...
2
by: shumaker | last post by:
I have a combobox that is very much like the one found in the RSS project here: http://msdn.microsoft.com/vstudio/express/visualCSharp/learning/ My projectNameComboBox basically is filled with a...
2
by: =?Utf-8?B?SmFtZXMgTWFydGlu?= | last post by:
I have a table that I dragged onto a form from a dataset. I changed some of the fields to comboboxes and set the data source, display member (text), and value member (int) to another table within...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.