Cara essa semana pesquisei sobre esse componente, a adobe na documentação dela fornece esse exemplo:
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var dpFlat:ArrayCollection = new ArrayCollection([ {Region:"Southwest", Territory:"Arizona", Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000}, {Region:"Southwest", Territory:"Arizona", Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000}, {Region:"Southwest", Territory:"Central California", Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000}, {Region:"Southwest", Territory:"Nevada", Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000}, {Region:"Southwest", Territory:"Northern California", Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000}, {Region:"Southwest", Territory:"Northern California", Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000}, {Region:"Southwest", Territory:"Southern California", Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000}, {Region:"Southwest", Territory:"Southern California", Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000} ]); ]]> </mx:Script> <mx:Panel title="AdvancedDataGrid Control Example" height="75%" width="75%" layout="horizontal" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> <mx:AdvancedDataGrid id="myADG" width="100%" height="100%" initialize="gc.refresh();"> <mx:dataProvider> <mx:GroupingCollection id="gc" source="{dpFlat}"> <mx:grouping> <mx:Grouping> <mx:GroupingField name="Region"/> <mx:GroupingField name="Territory"/> </mx:Grouping> </mx:grouping> </mx:GroupingCollection> </mx:dataProvider> <mx:columns> <mx:AdvancedDataGridColumn dataField="Region"/> <mx:AdvancedDataGridColumn dataField="Territory"/> <mx:AdvancedDataGridColumn dataField="Territory_Rep" headerText="Territory Rep"/> <mx:AdvancedDataGridColumn dataField="Actual"/> <mx:AdvancedDataGridColumn dataField="Estimate"/> </mx:columns> </mx:AdvancedDataGrid> </mx:Panel> </mx:Application> Se vc debugar a app vera como fica a estrutura do dpFlat, baseando nisso montei esse exemplo, pois meus objetos viram sempre de um banco de dados espero que ajude : <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="montaAdvadataGrid()"> <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.collections.ArrayCollection; [Bindable] private var arData:ArrayCollection = new ArrayCollection(); private function montaAdvadataGrid():void{ for(var i:int=0;i<5;i++){ var pai:Object = new Object; pai.nome = "Pai " + i; for(var j:int=0;j<3;j++){ var arrFilhos:ArrayCollection = new ArrayCollection(); for(var h:int=0;h<3;h++){ var filho:Object = new Object; filho.nome = "Jao "+i; filho.idade = "10"; arrFilhos.addItem(filho); } pai.filhos= arrFilhos; } arData.addItem(pai); } } ]]> </mx:Script> <mx:AdvancedDataGrid width="100%" height="100%" dragEnabled="true" dropEnabled="true" dragMoveEnabled="true"> <mx:dataProvider> <mx:HierarchicalData source="{arData}" childrenField="filhos"/> </mx:dataProvider> <mx:columns> <mx:AdvancedDataGridColumn headerText="Nome" dataField="nome"/> <mx:AdvancedDataGridColumn headerText="Idade" dataField="idade"/> </mx:columns> </mx:AdvancedDataGrid> </mx:Application> --~--~---------~--~----~------------~-------~--~----~ Você recebeu esta mensagem porque está inscrito na lista "flexdev" Para enviar uma mensagem, envie um e-mail para flexdev@googlegroups.com Para sair da lista, envie um email em branco para flexdev-unsubscr...@googlegroups.com Mais opções estão disponíveis em http://groups.google.com/group/flexdev -~----------~----~----~----~------~----~------~--~---