I have one textboxcolumn
and comboboxcolumn
in datagridview
. I need to change selecteditem when I enter value in TextBoxColumn
based on valuemember of comboboxcolumn
.
TextBoxColumn- name = itnum
ComboBoxColumn - name = itname
ComboBoxColumn
-------------------------
Value Display
--------- ----------
1 Item 1
2 Item 2
3 Item 3
-------------------------
Private Sub GV_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles GV.CellEndEdit
Select Case GV.Columns(e.ColumnIndex).Name
Case "itnum"
GV.Item("itname", e.RowIndex).Value = GV.Item("itnum", e.RowIndex).Value
End Select
When I run this code, Error popup like this
My requirement is when I enter 3 in TextBoxCell, ComboBoxCell should automatically change selectedItem to Item 3