I have rows of text data that can vary between 0 and 100, and all need to be visible on the screen at one time. The default behavior is fine for the grid until the rows * rowHeight > gridHeight.
Basically I need a hook into the item height, or row height to calculate it based on the height of the grid. I’ve set paddingTop and paddingBottom to zero, but there is still a considerable amount of white space in between rows.
My datagrid component…
<mx:DataGrid xmlns:mx='http://www.adobe.com/2006/mxml' creationComplete='OnCreationComplete()' paddingTop='0' paddingBottom='0' > <mx:Script> <![CDATA[ private function OnCreationComplete():void { //setRowHeight(10); } override protected function setRowHeight(v:Number):void { super.setRowHeight(v); } ]]> </mx:Script> </mx:DataGrid>
setRowHeight() helps, but the itemRender for the cell bigger than the cell, if I set the row height to something like 10.
Thank you inferis, that helped me a lot. This is my final grid component. It’s not really self contained because of a few call-outs, but if it helps someone else get theirs to work, great!