How to move the current cell of datagridview to next column in the same using cellendedit event?
<p>I am using datagridview to enter values quickly as i am new to it i am not able to move the current cell to next column in the same row. I am using the CellEndEdit event of the grid view since it gets fired after the editing is completed i.e on enter key by default. But when the first value is entered the row index automatically increments to 1, rather i want to be the same unless i change it. Can any please help me out with it , i'll be very thankful.</p>

<p>Here's the code that i m using</p>

<pre><code>//the name of the datagridview is dgvdatentry.....


 private void dgvdataentry_CellEndEdit(object sender, DataGridViewCellEventArgs e)
    {

                int iColumn = dgvdataentry.CurrentCell.ColumnIndex;
                int iRow = dgvdataentry.CurrentCell.RowIndex;
                if (iRow == dgvdataentry.Rows.Count - 1 &amp;&amp; iColumn == dgvdataentry.Columns.Count - 1)
                {
                    MessageBox.Show("End of rows....");
                }
                else
                {
                    if (iColumn == dgvdataentry.Columns.Count - 1)
                    {
                        dgvdataentry.CurrentCell = dgvdataentry[1, iRow + 1];
                    }

                    else
                    {
                        if (dgvdataentry.CurrentCell.Value != null)
                        {

                           // MessageBox.Show(dgvdataentry.CurrentCell.Value.ToString());
                            dgvdataentry.CurrentCell = dgvdataentry[iColumn + 2, iRow];
                            dgvdataentry.BeginEdit(true);

                        }
                        else { }
                    }
                }
</code></pre>
