http://www.mikenimer.com/index.cfm/2006/10/3/BackgroundRowColor-DataGrid-component


----- Original Message ----
From: Dominic Pazula <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, February 12, 2008 7:08:20 AM
Subject: [flexcoders] AdvancedDataGrid - Changing the background color on a row.

I thought this would be easy to do, but I have been banging my head 
on it for a while. I'm wanting to let the user "mark" rows as they 
scroll through the ADG. 

I created a function myRowStyle and set styleFunction= "myRowStyle" . 
What I cannot figure out is how to change the background color on the 
row. I've figured out how to change just about everything else.

Here is the myRowStyle function. I am just setting a static set of 
rows to the style to help me figure this out.

private function myRowStyle(data: Object, 
col:AdvancedDataGri dColumn): Object{
var vals:Array = [0, 2, 4, 6];

var i:int = dg.dataProvider. getItemIndex( data);

if (vals.indexOf( i) >= 0){
var o:Object = new Object;
o.color = 0x000000;
o.fontWeight = "bold";
o.backgroundColor = 0xFF0000;
return o;
}
else return null;
}

o.backgroundColor is just my latest attempt. I've tried everything I 
can think of, but obviously have not thought of everything.

Does anyone know the trick to doing this?

Thanks
Dominic





      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

Reply via email to