Hello, I was generating columns for a datagrid dynamically, but wanted to align number columns on right and hence I used following code to assign renderer to the gridcolumn:
var gc:GrdiColumn = new GridColum('Growth'); var ir:ClassFactory = new ClassFactory(SpreadItemRenderer); ir.properties = {textAlign:'right'}; gc.itemRenderer = ir; SpreadItemRenderer.as : public class SpreadItemRenderer extends GridItemRenderer { public var textAlign:String; public function SpreadFormatRenderer() { super(); } override protected function createChildren() : void { super.createChildren(); if(labelDisplay) { labelDisplay.setStyle("textAlign", textAlign); } } } But, when I do that, column do not display any data in the datagrid. When I debugged, I see that labelDisplay is always null. Isn't labelDisplay used to display data under GridItemRenderer? What am I missing here? I am using Flex 4.12.0 | AIR 4.0 | FP 12.0 for a mobile app (iPad).