How to control a spark Datagrid's scroller position in Flex?
I'm using the new Spark Datagrid for a project, but I must confess the scroller is annoying me a little bit, so I would like to have some control over it.
In other words, I would like to p开发者_如何学Crogramatically set the Datagrid scroller position to the position I want.
Thank you in advance.
- Setting the horizontal scroll position in the HorizontalList control in Flex
- Setting the vertical scroll position on a Spark List control in Flex 4
- Programmatically scrolling the Spark TextArea control in Flex 4
- Flex 4 List remembering verticalScrollPosition
- Scroll automatically to the bottom of a Container or TextArea
hope these links will work for you.
While the links above are useful to get to the answer, here is the direct answer:
someDataGrid.grid.layout.verticalScrollPosition
Simply use ensureCellIsVisible
datagrid.ensureCellIsVisible(dgArrayCollection.length - 1,-1);
where dgArrayCollection is the dataprovider of the datagrid
精彩评论