Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   Progamatically Scroll DataGrid Control (http://www.go4expert.com/forums/progamatically-scroll-datagrid-control-t10087/)

ABoy 17Apr2008 06:56

Progamatically Scroll DataGrid Control
 
HI

I'm using a Win forms data grid control and want to progamatically select a record in it. I have done it and the problem I have is, to get in to the auto selected row user have to scroll the grid.

I need to find a method to automatically scroll the grid for the selected record so the user don't have to do any action to get to the position?

Thanks

excavator 25Apr2008 12:57

Re: Progamatically Scroll DataGrid Control
 
you can use datagrid.currentcell property
Code:

datagrid.CurrentCell = New DataGridCell(r, c)
where r = index of the selected row and c = index of the column

hope this help

ABoy 28Apr2008 03:51

Re: Progamatically Scroll DataGrid Control
 
Cool, that did help thanks Excavator


All times are GMT +5.5. The time now is 15:35.