Was 560 really the right number? Or was it closer to 612? You have to factor in viewMetrics as well. Are you using a custom renderer and have verified it measures correctly?
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 djhatrick Sent: Thursday, June 18, 2009 2:42 PM To: [email protected] Subject: [flexcoders] Re: Accurate way of measuring a datagrid Tom: Thanks for that, but unfortunately that method is inaccurate( Maybe it doesn't work for very good for factories... Here's how i am getting my height, i am setting a height on my value object after i add my labels in a vertical column, then i listen for an event on my collection dataProvider, the last item, which I then loop through and calculate the values? See my examples: idSGrid.measureHeightOfItems 612 Measuring each row height--------> 560 idSGrid.measureHeightOfItems 612 Measuring each row height--------> 560 It's off by 72 pixels... that's quite a difference. Patrick --- In [email protected]<mailto:flexcoders%40yahoogroups.com>, "Tim Hoff" <timh...@...> wrote: > > > Hi Patrick, > > private function resizeDataGrid():void > { > myDataGrid.height = myDataGrid.measureHeightOfItems(0, > myDataGrid.dataProvider.length) + myDataGrid.headerHeight + 2; > } > > <mx:DataGrid id="myDataGrid" valueCommit="resizeDataGrid()"> > > -TH > > --- In [email protected]<mailto:flexcoders%40yahoogroups.com>, > "djhatrick" <djhatrick@> wrote: > > > > My datagrid won't measure correctly, i have variable row height, but > it can't seem to get it right, I don't want any scroll bars..., is there > an easy way to override some function so i can get the actual rowheight > of each row and determine my height correctly > > > > Thanks,Patrick > > > > > > Wow, i had to rejoing Flexcoders.... Google Groups are better than > yahoogroups, sorry yahoogroups, > > >

