for example here i'm try to set focus to next cell based on current cell
int columnIndex = dataGridView.CurrentCell.ColumnIndex;
int rowIndex = dataGridView.CurrentCell.RowIndex;
SetFocus(rowIndex , columnInde+1 );
you can set focus as below
public void SetFocus(int row, int column)
{
datagridview.Focus();
datagridview.CurrentCell = datagridview.Rows[row].Cells[column];
}