I seem to have a problem setting the value of a combobox in a datagridview. I am able to successfully bind a dataTable to my dataGridView and display all of the data in the gridView with the exception of the combobox. If I change the combobox column to a textBox then the data for that column is displayed. If I leave it a combobox then just blank values are displayed. Here is the code I use to populate the grid and also set the values in the combobox itself. Of course I comment out the combobox related code if I change the column to a textbox:
What am I doing wrong in binding a value to the combobox? I have other comboboxes in the dataGridView which display data properly, however, these comboboxes have "hardcoded" values.
Thanks
Code:
Dim cBoxBuddy As New DataGridViewComboBoxColumn()
Dim buddyTab As DataTable
Dim participantTable As New DataTable()
...'Loads the DataTable objects with data
' The dataGridView name is "personnelDataGrid"
' Bind the dataTable to the dataGridView
Me.personnelDataGrid.DataSource = participantTable
'Load the combobox values in the datagridview
cBoxBuddy = Me.personnelDataGrid.Columns("Buddy")
cBoxBuddy.DataPropertyName = "buddyID"
cBoxBuddy.DisplayMember = "buddyName"
cBoxBuddy.ValueMember = "buddyID"
cBoxBuddy.DataSource = buddyTab
What am I doing wrong in binding a value to the combobox? I have other comboboxes in the dataGridView which display data properly, however, these comboboxes have "hardcoded" values.
Thanks