tags:

views:

88

answers:

1

How a particular cell can be filled with any color in advanced data grid.

+1  A: 

If you meant column:

<mx:AdvancedDataGridColumn 
    backgroundColor="#00ff00" 
    dataField="data_field"
    headerText="The Header"/>

In case you really need to color a cell, use a custom item renderer, and add the bgColor to the data provider.

<mx:AdvancedDataGridColumn 
  itemRenderer="path.to.MyTextInput"/>
<!-- path/to/MyTextInput.mxml -->
<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml"&gt;
  <mx:Script>
    <![CDATA[
      override public function set data(value:Object):void
      {
        super.data = value;
        this.text = value.dataField;
        this.setStyle("backgroundColor", value.bgColor);
      }
    ]]>
  </mx:Script>
</mx:TextInput>
Amarghosh