Q:

How to move cursor to the next row in datagridview

I have a Windows Form that contains 2 datagridviews and a button between them to transfer the data. I cannot figure out how should i move the cursor of selected row to the next row after the button has successfully transfer the data. 

A:

if (dataGridView1.CurrentRow != null)
    dataGridView1.CurrentCell =
        dataGridView1
        .Rows[Math.Min(dataGridView1.CurrentRow.Index + 1, dataGridView1.Rows.Count - 1)]
        .Cells[dataGridView1.CurrentCell.ColumnIndex];

