开发者

scroll DataGridView

开发者 https://www.devze.com 2023-02-05 11:48 出处:网络
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\".

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消