Here's what I did to accomplish this:
- Create a class that extends AdvancedDataGridGroupItemRenderer
- In the new class override updateDisplayList and do what you need to do
- Assign the new class to the groupItemRenderer property of the AdvancedDataGrid
Here's what your new class might look like
public class CustomGroupRenderer extends AdvancedDataGridGroupItemRenderer
{
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
var listData:AdvancedDataGridListData = listData as AdvancedDataGridListData;
var advancedDataGrid:AdvancedDataGridDataGrid = listData.owner as AdvancedDataGrid;
var cellBackgroundColor:uint = 0xFF0000;
var g:Graphics = graphics;
g.clear();
if (!advancedDataGrid.isItemSelected(data) && !advancedDataGrid.isItemHighlighted(data))
{
g.beginFill(cellBackgroundColor);
g.drawRect(0, 0, unscaledWidth, unscaledHeight);
g.endFill();
}
}
}
And then assign this class to the groupItemRenderer property of the AdvancedDataGrid:
<mx:AdvancedDataGrid groupItemRenderer="com.whereever.CustomGroupRenderer"/>
Or, in ActionScript:
myAdvancedDataGrid.groupItemRenderer = new ClassFactory(com.whereever.CustomGroupRenderer);