scroll DataGridView
Visual Basic 2005
I have a DataGridV开发者_如何学编程iew 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.
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.
精彩评论