Hi,
         We can achieve it using itemrender in below mentioned way not
sure about labelfunction.
==============================================================================
Renderclass ColorLable.mxml
------------------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Label xmlns:mx="http://www.adobe.com/2006/mxml";>
        <mx:Script>
                <![CDATA[
                        import mx.states.SetStyle;
                    private var valueChangedFlag:Boolean;
                        override public function set data(value:Object):void
                        {
                                super.data=value;
                                if(value.state>2){
                                        valueChangedFlag=true;
                                }
                                invalidateDisplayList();
                        }
                        override protected function 
updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
                        {
                                
super.updateDisplayList(unscaledWidth,unscaledHeight);
                                if(valueChangedFlag)
                                this.opaqueBackground=0x33CC33;

                        }
                ]]>
        </mx:Script>
</mx:Label>
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
MainApplication class
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="vertical" verticalAlign="middle"
 xmlns:renders="com.renders.*">

 <mx:ArrayCollection id="items">

         <mx:Object name="Item 1" state="1" />
         <mx:Object name="Item 2" state="3" />
         <mx:Object name="Item 3" state="5" />
         <mx:Object name="Item 4" state="1" />
         <mx:Object name="Item 5" state="0" />

 </mx:ArrayCollection>



 <mx:DataGrid id="myGrid" dataProvider="{items}" editable="true">
     <mx:columns>
         <mx:DataGridColumn dataField="name" headerText="Name"
itemRenderer="com.renders.ColorLable"/>

         <mx:DataGridColumn dataField="state" headerText="Price"
textAlign="right"
itemRenderer="com.renders.ColorLable"/>


     </mx:columns>
 </mx:DataGrid>

</mx:Application>
===============================================================================================
On Mar 11, 5:33 pm, Venkat <[email protected]> wrote:
> hi,
>
> we have to put  alternatingItemColors="[#cccccc,#ffffff]" in the datagrid.
>
> I think this may help you....
>
> <mx:DataGrid dataProvider="{mydata}"
> alternatingItemColors="[#cccccc,#ffffff]" >
>
> thanks and Regards,
> venkat.R
>
> On Thu, Mar 11, 2010 at 1:05 PM, flex <[email protected]> wrote:
> > hi all,
> > i am showing some data in datagrid using labelfunction.
> > I want to check conditions if     value is  more than 10 , color of
> > that row or column  should be change .
> > how can we do it?
> > thank you.
>
> > --
> > 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]<flex_india%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/flex_india?hl=en.

-- 
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