Hi!
I have a DataGridView, it's DataSource is set to a DataTable. One column in the table has only three possible values "C","N","O". I managed to get a ComboBox showing in the DataGridView in a new Column with this code:
However, I don't know how to link this cell to the according value in the column of the DataGridView.
Should I update the combobox of each row one by one? This does not seem to be a nice solution to me.
I have a DataGridView, it's DataSource is set to a DataTable. One column in the table has only three possible values "C","N","O". I managed to get a ComboBox showing in the DataGridView in a new Column with this code:
Code:
Dim cmb As New DataGridViewComboBoxColumn()
Dim myTab As New DataTable
myTab.Columns.Add("id", GetType(String))
myTab.Columns.Add("value", GetType(String))
myTab.Rows.Add("C", "certified")
myTab.Rows.Add("O", "controlled")
myTab.Rows.Add("N", "unknown")
Dim GColumn As New DataGridViewComboBoxColumn
GColumn.HeaderText = "Certification"
GColumn.DataSource = myTab
GColumn.DisplayMember = "value"
GColumn.ValueMember = "id"
newGrid2.Columns.Add(GColumn)
Should I update the combobox of each row one by one? This does not seem to be a nice solution to me.