mshfGrid row at top

Carrie
04-09-2003, 05:37 AM
I am displaying loads of data in a grid which is fine and works OK. Now what I need to do is when the form with the grid opens, I want the top line of the grid to display a certain line in my recordset (could be somewhere in the middle of my table) with the ability to scroll up as well as down.

In other words - if say I have a grid with its first column displaying numbers 1 - 100000 and my current number is 163 - I want to load the grid with 163 at the top and allow the user the ability to scroll up to no 1, and down to 100000. It just has to start at the record which is current when it is loaded.

Carrie
04-09-2003, 11:28 AM
I have found the row number that I want to appear at the top of my grid. I still want to be able to scroll above and below it - how do I dynamically set the row number to be the top row? If I code .rowsel = iRow I just get all the previous rows highlighted, I need to scroll to the one I want - I'm sure this is really easy???

Thinker
04-09-2003, 04:11 PM
Set Row, not RowSel. It automatically selects all rows between the one
in Row and the one in RowSel which is why it selected all the previous
rows when you set RowSel. As soon as you set Row, RowSel is cleared.

Flyguy
04-10-2003, 02:38 AM
If I understand correctly you should use the .TopRow property.
If you do .TopRow = 163 then row 163 will be on first visible row in the grid.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum