I have a simple form with 1 datagridview that has 2 columns. If I'm at the end of the first column and I press enter, I want to set the current cell to the first row of the next column. Below is my code. For some reason, the focus keeps moving to the 2nd row, and not the 1st. Am I missing something?
Public Class Form1
Private Sub DataGridView1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DataGridView1.KeyDown
If e.KeyCode = Keys.Enter Then
If DataGridView1.CurrentCell.ColumnIndex = 0 Then
DataGridView1.CurrentCell = DataGridView1(1, 0)