PDA

View Full Version : Controlling Grid scrollbar



darkling235
25 Jan 2010, 8:47 AM
I'm building a grid that pages automatically as the user scrolls toward the bottom of the grid.

That part is working, no problem.

But I want to control the scrollbar more.

What happens is the user scrolls down to the bottom of the page, I add the next 50 rows and the moving piece of the scrollbar shrinks a little but doesn't move. What this means is that a user can't (for example) scroll rapidly down to the bottom and load items 5000-5050 and nothing else.

I can get the current location on the scrollbar but what I really need is a way to discern how big the scroll is so I know at what % of the scrollbar the user is at, and if possible I'd really like to be able to set the scroll size equal to the ~ how big it would be if all records were loaded so I could let them load small chunks in random order (depending on where they are on the scrollbar) rather than loading chunks sequentially whenever they go toward the bottom.

I've debated adding X number of empty rows to the grid where X is the total number of rows for this query, and only fetching them as they are needed but that strikes me as a somewhat hacky solution.

Can anyone tell me how I can access and set the scroll properties? Specifically I'd like to get and set the maximum position for the V scrollbar. Any help would be great.