title: Move to next cell on key enter
body: <p>I need to change the <kbd>Enter</kbd> key functionality in a datagridview , I want to prevent it to go to a new line I need it to move to the next cell I have tried a lot of logic to do this without success the last one of them was </p>
  
  <pre><code>if (e.KeyData == Keys.Enter)
      {
          int col = dgvPayments.CurrentCell.ColumnIndex;
          int row = dgvPayments.CurrentCell.RowIndex;
  
          if (col &lt; dgvPayments.ColumnCount - 1)
          {
              col++;
          }
          else
          {
              col = 0;
              row++;
          }
  
          if (row == dgvPayments.RowCount)
              dgvPayments.Rows.Add();
  
          dgvPayments.CurrentCell = dgvPayments[col, row];
          e.Handled = true;
      }
  </code></pre>
  
  <p>that works great when only press <kbd>Enter</kbd> not after edit a cell , 
  If I enter a cell and edit it and press the key <kbd>Enter</kbd> it goes to the next row and the column after I was in.</p>