473,394 Members | 1,802 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,394 software developers and data experts.

set the valuemember of combobox to a project property

Hello,
I wish to set the valuemember of a combobox to the
value of a property in a class(projlist - see below). I
wish to set the valuember of the combobox cmbstatus to the
value of property "status" in the class Projlist)

Below is how I bind the text field phone on form Myform to
the property phone in class projlist, this works fine.
MyForm.Phone.DataBindings.Add("text",
ProjList, "phone")

However if I do
Myform.cmbstatus.databindings.add
("valuemember",projlist,"status")

I get the message can't bind to this valuemember.

Please help

Geraldine

Nov 20 '05 #1
1 1277
If you want to change the value member , you change it in the source
DataSet.DataTable, not the ComboBox.
Regards - OHM


geraldine hobley wrote:
Hello,
I wish to set the valuemember of a combobox to the
value of a property in a class(projlist - see below). I
wish to set the valuember of the combobox cmbstatus to the
value of property "status" in the class Projlist)

Below is how I bind the text field phone on form Myform to
the property phone in class projlist, this works fine.
MyForm.Phone.DataBindings.Add("text",
ProjList, "phone")

However if I do
Myform.cmbstatus.databindings.add
("valuemember",projlist,"status")

I get the message can't bind to this valuemember.

Please help

Geraldine


Regards - OHM# OneHandedMan{at}BTInternet{dot}com
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: cody | last post by:
I do not think it is good style to use these because you have to hardcode the propertynamed in your code as string literals. Wouldn't it be better to use delegates instead? ...
1
by: Jim Heavey | last post by:
If you have a comboBox which has it's DisplayMember and ValueMenber bound to a datatable. If I know the "ValueMember" value - is there a way for me to set the index of the control to correspond...
0
by: Beringer | last post by:
I have implemented a combobox and have set the DataSource to an ArrayList. I next set the DisplayMember and ValueMember properties. When I run the code the combobox will display the proper text...
1
by: Bruce A. Julseth | last post by:
Does the ValueMember property in the ComboBox work like the DisplayMember property. For example, if I set the properties: comboBox1.DataSource = dataSet1;comboBox1.DisplayMember =...
4
by: al | last post by:
Greetings, As I understands it, SelectedValud of combobox reads its value from ValueMember property of the combobox. This doesn't work with me. What happens is just randome update. This is the...
1
by: Phill. W | last post by:
Am I missing something here? I have a simple class that exposes String properties called "Key" and "Description". I have a Control inherited from a ComboBox, into whose Items collection I've...
1
by: Bruce A. Julseth | last post by:
Sorry. The other post got sent before I was complete. Does the ValueMember property in the ComboBox work like the DisplayMember property. For example, if I set the properties: ...
5
by: Spam Catcher | last post by:
Hello all, I can't seem to set the value member properly in code... I'm using a ComboBox in DropDownList mode: Private Class ApplicationsComboBoxItem Private _Name As String Private...
2
by: Cdude | last post by:
Please can anyone tell me how to display the valuemember of a combobox which is databound I have tried MessageBox.Show(Combobox1.ValueMember.ToString()) this displays the Column name to which the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.