我Friend WithEvents PersonName As DataGridViewComboBoxColumn在 DataGridView 中用作列并PersonName DataSoucre绑定到数据库。我想在ComboBox更改选择时使用该值来查询我的数据库业务对象以找到正确的值,然后我想将查询中的值设置ComboBox为名为的列的右侧Colum3。
但是我没有使用如何访问ComboBox单元格的每个单独的事件处理程序,我尝试过dgvTable.CellBeginEdit但它触发得太早了。
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