I am using Friend WithEvents PersonName As DataGridViewComboBoxColumn
as a column in DataGridView and PersonName
DataSoucre
is bounded to a database. I would like for when the ComboBox
Selection is changed it uses that value to query my database Business Object to find the right value then I want to set the value from the query to the column to the right of the one with the ComboBox
which is named Colum3
.
But am not use how to access each individual event handler for the ComboBox
cell, I tried dgvTable.CellBeginEdit
but it triggers too early.
Private Sub dgvTable_CellBeginEdit(sender As Object, e As DataGridViewCellCancelEventArgs) Handles dgvTable.CellBeginEdit
If e.RowIndex <> -1 And e.ColumnIndex <> -1 Then
dgvTable.Rows(e.RowIndex).Cells("Colum3").Value = dgvTable.Rows(e.RowIndex).Cells(e.ColumnIndex).Value & "Somevalue from my databse"
End If
End Sub