:) well i'm solved the problem in two different ways but i
still don't like the solution. Anyways here is where i got to so
far
1- handle the resize event of the datagrid's container. you
can inherit the datagrid and addlisteners to its parent.
There you should check the total size of the rows + the
header. If the rowsTotal > containerheight you set the
grid.percentHeight = 100 else if the container height >
rowsTotal you set the grid.height = rowsTotal
2- This one is neat , but seems adobe didn't fulfill the
implementation ..it has some bugs .. not exactly obvious
You need to extend the datagrid and override
makeRowsandColumns ..
override protected function makeRowsAndColumns(left:Number,
top:Number,
right:Number, bottom:Number,
firstCol:int, firstRow:int,
byCount:Boolean = false, rowsNeeded:uint = 0):Point
{
var bottomTemp:Number =bottom;
var calculatedHeight:Number ;
//method a)
if (!cme_fullheight && dataProvider!=null) //only
draw rows as the need arrises
{ calculatedHeight =
measureHeightOfItems(-1,super.dataProvider.length + (headerVisible
? 1:0)) + (horizontalScrollBar != null &&
horizontalScrollBar.visible ? horizontalScrollBar.height : 0 );
if (height > calculatedHeight )
bottomTemp = calculatedHeight;
}
//method b)
// byCount = true; //for some reason adobe left this out
from public datagrid attributes donno why .. probably its buggy
//rowsNeeded = dataProvider.length ;
return
super.makeRowsAndColumns(left,top,right,bottomTemp,firstCol,firstRow,byCount,rowsNeeded)
;
}