cometbill
cometbill

Reputation: 1619

scroll DataGridView

Visual Basic 2005

I have a DataGridView on a form. It's bound to a DataSet, and I'm working by way through the dataset doing various things to the records based on the "status". What I would like to do is scroll the grid, so that the row that the program is 'looking at' is in the middle of the grid.

Upvotes: 0

Views: 1167

Answers (1)

fjdumont
fjdumont

Reputation: 1537

There is a DataGridView.FirstDisplayedScrollingRowIndex property that does the job for you. In case the row height is fixed, this should be an easy problem. If they are not, you will have to iterate through the previous items and calculate their height.

Upvotes: 1

Related Questions