NicoRiff
NicoRiff

Reputation: 4883

Get the first displayed row of datagridview

can anyone tell me how I can get the first displayed row on a datagridview?. I need to get the first row whenever the user scrolls on the datagridview, whether the user has selected the row or not.

Can anyone tell me if this can be done?.

Thanks.

Upvotes: 0

Views: 2594

Answers (2)

Gustavo Batista
Gustavo Batista

Reputation: 11

you can try this : datagridview.rows[0];

Upvotes: 0

Dmitry
Dmitry

Reputation: 14059

Use the DataGridView.FirstDisplayedScrollingRowIndex property.
And make sure all rows have the same height.

Upvotes: 3

Related Questions