Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I position a DataGridView to a specific row (so that the selected row is at the top)

I have an application with a DataGridView on it and I would like to position the rows such that a specific row is at the top of the list.

I don't want a sort, I want a way to programmatically tell the DataGridView "scroll to the Nth row."

Any ideas?

like image 851
Michael Todd Avatar asked Apr 27 '09 20:04

Michael Todd


People also ask

How many rows can DataGridView handle?

Max value, i.e. 2,147,483,647. The DataGridView's RowCount cannot hold a number more than this because it's an integer. So, you can possibly say that limit for datagridview rows is 2 Billion.

Which property of DataGridView or Datatable gives the number of rows?

Use the GetRowCount and GetRowsHeight methods to determine the number of rows or the combined height of rows in a particular state.


1 Answers

How about FirstDisplayedScrollingRowIndex?

like image 168
Marc Gravell Avatar answered Oct 13 '22 18:10

Marc Gravell