Visual studio 2010-C#: Go to a specific row in DataGridView

for example:
Go to the next row
or
Going into the last row
or
Going to the Row 4

What code should be written?

Upvotes: 1

Views: 223

Answers (1)

VikciaR
VikciaR

Reputation: 3412

Set DataGridView1.CurrentCell to first cell of the needed row:

DataGridView.CurrentRow To change the current row, you must set the CurrentCell property to a cell in the desired row.

DataGridView.CurrentCell The DataGridViewCell that represents the current cell, or null if there is no current cell. The default is the first cell in the first column or null if there are no cells in the control.

Upvotes: 2

Related Questions