Get first column in combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I get the value in the first column of a combo box?

cboRails.DataSource = ds1.Tables[1];
cboRails.DisplayMember = "Description";


The combo box shows the "Description" column of my table. When the user
selects from the combo box I want to grab the key. I tried cboRails.text but
I get the value in the description, I want the value of the key, which is in
column 1.
 
You could set the ValueMember property of the ComboBox to the name of the
key column and then use the SelectedValue property to get the value.
 
Hi Cadel,

Does "Tim Wilson"'s reply make sense to you? Is your problem resolved?
Please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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

Back
Top