use
RowHeaderMouseClick
Event,
The problem is when you select the entire row using row header, the entire row (all cells) gets selected and the
CurrentCell
property is not working as expected to select a particular cell in the selected row,
i did a workaround by selecting the next or prev row's cell temporarily and then switching back to the current Row, by doing so, it works good. I am not saying this is the only solution, there might be some other, explore it.
try this,
Private Sub dataGridView1_RowHeaderMouseClick(ByVal sender As Object, ByVal e As DataGridViewCellMouseEventArgs)
Dim currentRow As Integer = e.RowIndex
Dim rowsCount As Integer = dataGridView1.Rows.Count
Dim tempSelectRowIndex As Integer = 0
If ((currentRow + 1) _
= rowsCount) Then
tempSelectRowIndex = (currentRow - 1)
ElseIf (currentRow < rowsCount) Then
tempSelectRowIndex = (currentRow + 1)
End If
dataGridView1.CurrentCell = dataGridView1.Rows(tempSelectRowIndex).Cells(0)
dataGridView1.CurrentCell = dataGridView1.Rows(currentRow).Cells(0)
End Sub