views:

287

answers:

1

I have an ADG along with some other components in a VBox. The number of rows of items in the ADG is variable. I want the height of the ADG to be however tall it needs to be to show all the rows without scrolling. This is because I want the containing VBox to handle all the scrolling.

The reason being, is because sometimes there is a horizontal scroll bar on the VBox, in this case you have to scroll all the way to the right to reveal the scroll bar for the ADG before you can scroll the ADG.

So is there a way to do this?

Thanks.

+1  A: 

You could bind the ADG's "rowCount" property to the length of the data provider:

rowCount="{ dataProvider.length }"

If that doesn't handle the rested rows property, then you could write a function that calculates the total number of rows:

rowCount="{ getRowCount( dataProvider ) }"

private function getRowCount( dataProvider:ArrayCollection ):int
{
    // walk through dataProvider and count up rows + nestedRows
}
cliff.meyers