If the grid is bound to aFor DataGridView you can get CurrentRow.Index, and use Rows.GetNextRow/GetPreviousRows method to get new index, notice it will be -1 if there is no next/previous row. Then you can change CurrentCell accordingly.
BindingSource
, which it generally ought to be, then you can call MoveNext
and MovePrevious
.