如何检查我是否在数据网格视图中点击了数据?
我尝试过dgv_click
,_mouseClick
,_cellcontentClicked
btnEdit.Enabled = true
btnDelete.Enabled = true
没有任何反应。答案 0 :(得分:0)
您需要为.CellClick
事件
Private Sub dgv_CellClick(sender AS Object, e As DataGridViewCellEventArgs) Handles dgv.CellClick
'you can get cell's rowindex and columnindex where was clicked
If e.RowIndex >= 0 AndAlso e.ColumnIndex >= 0 Then
'here put your code based on the clicked cell
End If
End Sub