• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 438
  • Last Modified:

How to specify scrollbar thumb position in Flex

Is there a way I can make a scrollbar thumb jump to a certain location so as to display the appropriate records applicable within its range? For example, if a datagrid that displays 10 records at a time had 500 records, scrolling the scroll bar thumb exactly at the center should roughly display the 245th to 255th records.

In order to do this, I'm guessing I would need to be able to get the beginning and end range of a scrollbar thumb. I'm sure one side has to be 0, but how do I get the END range value of a scrollbar thumb?

And secondly, how can I manually position the scrollbar thumb within the scrollbar?

Does anyone have any experience doing this? Thanks.
0
elepil
Asked:
elepil
  • 2
1 Solution
 
heppaCommented:
Hey.

simply use:

dataGrid.validateNow();
dataGrid.verticalScrollPosition = 50;

this will put element 50 as top visible element.

To find out about the number you wish to scroll to is simple math ;)
0
 
heppaCommented:
btw: there is a property dataGrid.maxVerticalScrollPosition that has the value of the last item to scroll to (normally means itemCount - gridSize).

good luck!
0
 
elepilAuthor Commented:
That was perfect! Thank you!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now