Try measureHeightOfItems?

DataGrid.height = DataGrid.measureHeightOfItems(0, gridrows) +
DataGrid.headerHeight;


I added this event to my data source and called measureHeightOfItems in the
listChanged function:

report.addEventListener(CollectionEvent.COLLECTION_CHANGE, listChanged);




On Mon, Feb 9, 2009 at 1:36 PM, patrickfkellogg
<[email protected]>wrote:

>   I have a problem with <DataGrid> that uses dynamically generated
> columns. When the cell has many characters the row resizes its height
> properly with word wrap to show all the cell's contents. But the next
> time the <DataGrid> is shown when there is no data the row height
> remains at the previous tall size. It doesn't resize back down. I
> remember the fix for this before was to place the wordWrap="true" in
> the <DataGridColumn> tag not in the <DataGrid> tag, but this is not an
> option since I am creating my columns dynamically. anyone seen this?
> Any fix? thanks.
>
> <mx:DataGrid
> id="datagrid"
> width="100%"
> height="100%"
> dataProvider="{report}"
> variableRowHeight="true"
> wordWrap="true"
>
> columns="{DataGridColumnFactory.fromColumnGroupVOCollection(report.columns,
> model.session.timezoneInfo)}" />
>
>  
>

Reply via email to