I have a DataGridView with the StandardTab property set to False. I would like the cell pointer to "wrap around" when navigating beyond the last column. In other words, I would like to keep the cell pointer within the same row when using Tab, Shift+Tab, left and right arrow keys. Then move up and down each column using the up & down arrows.
The only method that has gotten me close is the PreviewKeyDown event. Here's my code but when the cell pointer is navigated beyond the last column, the pointer goes to the second column rather than the first.
Thank you!
The only method that has gotten me close is the PreviewKeyDown event. Here's my code but when the cell pointer is navigated beyond the last column, the pointer goes to the second column rather than the first.
Private Sub dgvMyGrid_PreviewKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs) Handles dgvMyGrid.PreviewKeyDown
If dgvMyGrid.CurrentCell.ColumnIndex = dgvMyGrid.ColumnCount - 1 Then
End Sub
If dgvMyGrid.CurrentCell.ColumnIndex = dgvMyGrid.ColumnCount - 1 Then
dgvMyGrid.CurrentCell = dgvMyGrid.Item(0, dgvMyGrid.CurrentRow.Index)
End IfEnd Sub
Thank you!