Sorry
missed that one .... theCell is the
ID of the mx:Text in the CellRenderer
I
shall rewrite the code for you ...
<mx:DataGrid
dataProvider="{selectedMonth.website}" width="100%"
height="30%">
<mx:columns>
<mx:Array>
<mx:DataGridColumn columnName="name" headerText="Website" width="200" cellRenderer="blacktext"/>
<mx:DataGridColumn columnName="value" headerText="Revenue" labelFunction="formatGridRevenue" cellRenderer="blackText"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
<mx:columns>
<mx:Array>
<mx:DataGridColumn columnName="name" headerText="Website" width="200" cellRenderer="blacktext"/>
<mx:DataGridColumn columnName="value" headerText="Revenue" labelFunction="formatGridRevenue" cellRenderer="blackText"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
// The CellRenderer File ------------------- blackText.mxml
<?xml version="1.0"
encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.macromedia.com/2003/mxml" width="100%" xmlns="*">
<mx:Canvas xmlns:mx="http://www.macromedia.com/2003/mxml" width="100%" xmlns="*">
<mx:Script>
<![CDATA[
function setValue(str:String,obj:Object) {
theCell.text = str;
}
]]>
</mx:Script>
<![CDATA[
function setValue(str:String,obj:Object) {
theCell.text = str;
}
]]>
</mx:Script>
<mx:Text id="theCell" color="#000000"
/>
</mx:Canvas>
</mx:Canvas>
Hope this helps!
Sree
-----Original Message-----What is theCell.text supposed to be ?
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Rich Tretola
Sent: Friday, May 13, 2005 9:07 PM
To: [email protected]
Subject: Re: [flexcoders] Style Question
Here is my grid:
<mx:DataGrid dataProvider="{selectedMonth.website}" width="100%" height="30%">
<mx:columns>
<mx:Array>
<mx:DataGridColumn columnName="name" headerText="Website"
width="200"/>
<mx:DataGridColumn columnName="value"
headerText="Revenue" labelFunction="formatGridRevenue"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
Rich
On 5/13/05, Sreejith Unnikrishnan <[EMAIL PROTECTED]> wrote:
> You're right ...
> You can use a cellRenderer ... (tested this time :-)
>
> // ColorRenderer.mxml
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Canvas xmlns:mx="http://www.macromedia.com/2003/mxml"
> width="100%" xmlns="*">
> <mx:Script>
> <![CDATA[
> function setValue(str:String,obj:Object) {
> theCell.text = str;
> }
>
> ]]>
> </mx:Script>
> <mx:Text color="#000000" />
> </mx:Canvas>
>
> In your datagrid column you can specify cellRenderer="ColorRenderer"
>
>
>
> Rich Tretola wrote:
> Nope, that didn't work as it turned all of the text black incluing the
> header text. Is there no way to have the header text a different
> color from the grid text ?
>
> Rich
>
> On 5/13/05, Sreejith Unnikrishnan <[EMAIL PROTECTED]> wrote:
> > Rich,
> >
> > Specify color="#000000" in the MXML code ... either in the mx:Datagrid
> or
> > in the mx:DataGridColumn (if you want each column to be a different
> color)
> > It should work ...
> >
> > Sree
> >
> >
> > Rich Tretola wrote:
> > This is my css style for the grid which makes the header color and
> > text the way I want it, but it also makes the grid text white, how can
> > I get the actual data text to be another color? I tried using both
> > the DataGridRow and DataGridColumn declarations but it doesn't effect
> > it:
> > DataGrid {
> > alternating-row-colors:#FEFEFE,#EFF3F6;
> > header-colors:#141C5A,#829194;
> > border-style:solid;
> > border-color:#CCCCCC;
> > v-grid-line-color:#CCCCCC;
> > roll-over-color:#D7E4E9;
> > color:#FFFFFF;
> > font-size:10px;
> > font-weight:normal;
> > text-indent:4;
> > }
> >
> > Tried adding the following to my css file.
> >
> > DataGridColumn {
> > color:#000000;
> > }
> >
> > DataGridRow {
> > color:#000000;
> > }
> >
> > Rich
> >
> >
> > On 5/12/05, Matt Chotin <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > > headerStyle I think (Available on both DataGrid for all columns and
> > > DataGridColumn for individual).
> > >
> > >
> > >
> > > ________________________________
> > >
> > >
> > > From: [email protected]
> > [mailto:[EMAIL PROTECTED] On
> > > Behalf Of Rich Tretola
> > > Sent: Thursday, May 12, 2005 6:48 PM
> > > To: [email protected]
> > > Subject: [flexcoders] Style Question
> > >
> > >
> > >
> > >
> > > What is the css property for changing the color of the header text of
> > > a datagrid ? When I change the color property, it changes the header
> > > text but also changes the grid text color which is not what I need.
> I
> > > need the 2 text colors set differently.
> > >
> > > Rich
> > >
> > >
> > > ________________________________
> > > Yahoo! Groups Links
> > >
> > >
> > > To visit your group on the web, go to:
> > > http://groups.yahoo.com/group/flexcoders/
> > >
> > > To unsubscribe from this group, send an email to:
> > > [EMAIL PROTECTED]
> > >
> > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
> >
> > ________________________________
> > Yahoo! Groups Links
> >
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/flexcoders/
> >
> > To unsubscribe from this group, send an email to:
> > [EMAIL PROTECTED]
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
> ________________________________
> Yahoo! Groups Links
>
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/flexcoders/
>
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

