Newbe ValueMember property question

B

Bruce A. Julseth

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:

comboBox1.DataSource = dataSet1
comboBox1.DisplayMember ="Employees.LastName"
comboBox1.ValueMember = "Employees.EmployeeID"

If I select from the box a "LastName", I can retrive that selected name. How
do I retrieve the "ValueMember" setting, ie the "EmployeeID" for the
selected "LastName."

Or, isn't that the way ValueMember works? Is so, how does it work and how is
it used. I'm looking for a replacement for the VB.Compatibility
"VB6.GetItemData."

Thank you..

Bruce
 
B

Bruce A. Julseth

Bruce A. Julseth said:
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:

comboBox1.DataSource = dataSet1
comboBox1.DisplayMember ="Employees.LastName"
comboBox1.ValueMember = "Employees.EmployeeID"

If I select from the box a "LastName", I can retrive that selected name. How
do I retrieve the "ValueMember" setting, ie the "EmployeeID" for the
selected "LastName."

Or, isn't that the way ValueMember works? Is so, how does it work and how is
it used. I'm looking for a replacement for the VB.Compatibility
"VB6.GetItemData."

Thank you..

Bruce

Never mind. I found the answer.. selectedValue property

Thanks..

Bruce
 

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