Guys and gals,

I'm stumped. I am trying to apply a custom text and background color to (initially) a specific cell in my grouped ADG, using a renderer provider and a custom renderer. The colors are coming from my dataset (part of the user's stored configuration preferences) and the text color is working perfectly. However, nothing I do is rendering the cell's background color the same way that the text color is doing. I've tried style functions, renderers, etc without luck. Any ideas?!?!

Here is the code:

My ADG column def:
<mx:AdvancedDataGridColumn id="groupedKitNum" dataField="KitNum" headerText="Kit Number" headerWordWrap="true" textAlign="left" width="75" editable="false" />

My renderer provider:
<mx:AdvancedDataGridRendererProvider id="subgroupRenderer" column="{groupedKitNum}" depth="1" columnIndex="1" columnSpan="4" renderer="renderers.GAPSubgroups.SubgroupRenderer"/>

My renderer code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Text xmlns:mx="http://www.adobe.com/2006/mxml"; implements="mx.core.IFactory"
   width="100%" height="100%" paddingLeft="2" paddingRight="2">
   <mx:Script>
       <![CDATA[
           import mx.utils.ObjectProxy;
override public function set data(dataItem:Object) : void
           {
               if (dataItem.children[0] is ObjectProxy)
               {
                   htmlText = dataItem.children[0].Description;
                   setStyle("color",dataItem.children[0].TextColor);
setStyle("backgroundColor", dataItem.children[0].BackgroundColor);
               }
           }
public function newInstance():*
           {
               return new SubgroupRenderer();
           }
       ]]>
   </mx:Script>
</mx:Text>

When I've walked through the code in the debugger, I can verify that the the background color is indeed being passed in the data set...it's just being ignored!

Anyone have any ideas?!

Thanks,
Adrian

Reply via email to