Hi,
I just need to set the Background color of the First Row to a
specific color and the rest of the rows can have the default background.
And the data for the grid is set using the dataProvider (
ArrayCollection) is set at runtime.
So i don't want this Item Renderer for each and every row.
Is there a simple way to do this..
I couldn't find a method to check the columnNumber from the passed
AdvancedDataGridColumn Object !!!
I have this method to set the style as per sreeni code..
private function setRowStyle(data:Object,
col:AdvancedDataGridColumn):Object{
// I need to check if the column is 0 and it
has a specific
value..(To determine this is the first row..)
if (col.){
return { rowColor:0xFF0000,
fontWeight:"bold" };
}
return {};
}
Thanks
Mars
--- In [email protected], "Cato Paus" <[EMAIL PROTECTED]> wrote:
>
> Also take a look at this
> http://weblogs.macromedia.com/pent/archives/2007/02/index.cfm
>
> Cato
>
>
> --- In [email protected], "Dominic Pazula" <dompazz@>
> wrote:
> >
> > Awesome! Thanks. I had put this on the back burner and was
> working
> > on the lower hanging fruit for my project.
> >
> > --- In [email protected], "sreeni_r" <sreeni_r@> wrote:
> > >
> > >
> > > I have posted a working sample here which I think you can tweak
> it
> > > work your scenario.
> > >
> > > http://flexpearls.blogspot.com/2008/02/row-background-color-
> in.html
> > >
> > > -Sreenivas
> > >
> > > --- In [email protected], "Dominic Pazula" <dompazz@>
> > > wrote:
> > > >
> > > > 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:AdvancedDataGridColumn):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
> > > >
> > >
> >
>