How to fill combobox with Datatable column C#

前端 未结 1 460
北恋
北恋 2021-01-27 05:27

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:

1条回答
  •  不思量自难忘°
    2021-01-27 05:53

    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"
    

    0 讨论(0)
提交回复
热议问题