Les AdvancedDataGrid ne permettent pas de préciser une couleur de fond pour chacune de leurs lignes. J'ai donc étendu un AdvancedDataGrid pour pouvoir le faire avec une styleFunction :

Cela s'utilise de cette manière :
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:acctl="fr.adriencolson.controls.*">
...
<mx:Script>
<![CDATA[
[Bindable]
private var adgData:Object = [{label:'Data 1', type:'t1', children:[{label:'Data 2', type:'t2'}]},
{label:'Data 3', type:'t1'},
{label:'Data 4', type:'t1', children:[{label:'Data 5', type:'t2'}, {label:'Data 6', type:'t2'}]}];
private function adgStyle(data:Object, column:AdvancedDataGridColumn):Object {
if (data.type == 't1') {
return {backgroundColor: 0xCC8888};
}
return null;
}
]]>
</mx:Script>
<acctl:RowBackgroundAdvancedDataGrid id="adg"
styleFunction="adgStyle"
displayItemsExpanded="true"
horizontalGridLines="true"
width="100%" height="100%">
<acctl:dataProvider>
<mx:HierarchicalData source="{adgData}" />
</acctl:dataProvider>
<acctl:columns>
<mx:AdvancedDataGridColumn headerText="Label" dataField="label"/>
<mx:AdvancedDataGridColumn headerText="Type" dataField="type"/>
</acctl:columns>
</acctl:RowBackgroundAdvancedDataGrid>
</mx:Application>
Limitation : Cela ne permet pas de préciser la couleur de fond d'une seule cellule, mais uniquement d'une ligne.

