I ended up having to calculate out the datagrid height after I populated
it... the code looked something like this:
populateGrid(event:ResultEvent):void {
acGridData = event.resut as ArrayCollection;
callLater(resizeGrid);
}
resizeGrid():void {
myGrid.height =
myGrid.measureHeightOfItems(-1,myGrid.dataProvider.length + 1);
}
I also had to set myGrid's verticalScrollPolicy = "off"
I had to callLater because the calculation was always wrong otherwise.
Shan
_____
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of arpan srivastava
Sent: Saturday, November 25, 2006 5:59 AM
To: Flex Coders; Flex Components
Subject: [flexcoders] resizing the datagrid ?
Hi ,
I facing a lot of problem for resizing the datagrid. I have created a
datagrid component which I am placing in a HBox.
I have to set the size of datagrid in percentage to make it resizable. Can
anyone tell me what properties of datagrid can I set in percentage, I need
to keep rowcount constant, that means rowheight will vary, now if I set
pecentageHeight to some value say 90%, it calculates the rowheight and also
the rowcount on it's own, so sometimes I get a extra empty row at the bottom
and sometimes the last row appears half.