The DG will measure the first item in the dataprovider.  If that isn't 
"typical" you can get bad results.  But first, make sure your custom renderers 
to accurately measure.  Lots of folks have problems especially if the renderer 
has something in it that word-wraps text.

I think you can just set rowHeight to a number that is "typical" and 
variableRowHeight will still work.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of [email protected]
Sent: Monday, November 16, 2009 11:04 AM
To: [email protected]
Subject: [flexcoders] measureHeightOfItems()



Dear All,

I have a component that is a composite of a datagrid and an advancedDataGrid - 
the datagrid being on top. The top datagrid shows the "primary" information, 
while the bottom grid shows everything grouped (using the grouping 
functionality of the AdvancedDataGrid), however I am having some serious issues 
with the sizing of the top grid.

The idea is that it is sized based on the components within it, however it has 
the most variables you can possibly get for such a scenario - namely, it has 
custom renderers in each case it's used (and it's not the same renderer each 
time), variableRowHeight is true - and has to be.

The problem I'm running into is that the measureHeightOfItems() gives me, 
occasionally, grossly inaccurate figures. I get the top grid being twice the 
size that it needs to be on occasion.

Does anyone know how to fix this or an alternative method?

Reply via email to