Reputation: 1188
I'm trying to add items to a combo box using a data table that already has some columns but I just want one of them values into the combo box. What i'm doing is this:
cbReviewers.DataSource = Reviewers_table.Columns[1];
but is not working, do you know how could I do it?
Upvotes: 0
Views: 7530
Reputation: 136
I think you need to use Display and Value members properties to work with display data.
cbReviewers.DataSource = Reviewers_table
cbReviewers.DisplayMember = "ColumnNameThatContainsText"
cbReviewers.ValueMember = "ColumnNameThatContainsValue"
Upvotes: 6