Flex 4.6 Mobile - Scrolling to the last added item in a dataGrid with variableRowHeight

Posted by user1305331 on Stack Overflow See other posts from Stack Overflow or by user1305331
Published on 2012-11-17T16:56:40Z Indexed on 2012/11/17 16:59 UTC
Read the original article Hit count: 288

Filed under:
|
|
|
|

I'm trying to set the scroll vertical position of a spark dataGrid to show the items as I add them to the grid. I know you can set the scroll position like this:

dataGrid.scroller.viewport.verticalScrollPosition = itemPosition*rowHeight;

The problem is that the dataGrid have variableRowHeight, as each row word wraps their name labels, and I don't know how to get each row height. I though of getting the itemRenderer associated with every item as I add it to the grid, and keep the total row height value in a variable, but don't know how to achieve that.

Is there any way to set the scroll position of a dataGrid with variableRowHeight to show the last added item?

© Stack Overflow or respective owner

Related posts about flex

Related posts about mobile