Hi,
 You can do it by overriding 'drawRowBackground' function of datagrid
bye extending the datagrid class.
  Example

create a Class MyDataGrid which extends datagrid.
see the code.***********************************************
package
{
  import flash.display.Sprite;

  import mx.collections.ArrayCollection;
  import mx.controls.DataGrid;

  public class MyDataGrid extends DataGrid
  {
    public var rowColorFunction:Function;

    override protected function drawRowBackground(s:Sprite,
        rowIndex:int, y:Number, height:Number, color:uint,
dataIndex:int):void
    {
      super.drawRowBackground(s, rowIndex, y, height, color,
dataIndex);
    }
  }
}
***************************************************************************************

In that  above class You can see a function called rowColorFunction.
Now Come to Your Datagrid Implementation part.
For example .
************************************************************

<common:MyDataGrid id="dg" dataProvider="{aryEmail}"
   width="100%" height="100%" rowColorFunction="changeRowColor">

</common:MyDataGrid>

In the Script>>>>>>>>
private function changeRowColor(item:Object,
rowIndex:int,dataIndex:int, color:uint):uint
 {
   if(item.unRead == true)
     return 0xCCCCCC;
   else
     return color;
 }
**************************************************************************
In the above code you need to assign changeRowColor function to
rowColorFunction, which will acts something same like labelFunction.

Good Luck...

Timmy

On Mar 7, 11:07 pm, Shishir <[email protected]> wrote:
> Hi,
>
> I have been trying to style the summary row in advancedDataGrid using
> the styleFunction method of advancedDataGrid.I have been able to style
> the summary row a bit using the following code but i have not been
> able to highlight(show it in different colour) the row :
>
> public function summaryStyle
> (data:Object,col:AdvancedDataGridColumn):Object
> {
>    var output:Object;
>  if ( data.children != null )
>  {
>      output = {color:0x081EA6, fontWeight:"bold", fontSize:14} ;
>  }
>  return output;
>
> }
>
> I tried setting properties like backGroundColour etc. but they don't
> seem to work.Can some one please guide me how can this be achieved
> using styleFunction?
>
> Thanks,
> Shishir.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to