7 Replies Latest reply on Mar 16, 2010 12:08 AM by Balagopalr

    Datagrid colour change



      Can anybody please tell me how to change color of a dynamic value in a data grid.The value has to change colour when a particular value is crossed and change back when value falls below that.Please help me with a sample code so that I can better understand it.




        • 2. Re: Datagrid colour change
          Balagopalr Level 1

          Thanks for the reply but the code u referred was not working.Can u just help me regarding this.I just want to a grid value(dynamic one) to change colour when the value crosses a threshold value and change back colour when the value falls down.Please can u give me a simple code for this so that i can work on it

          • 3. Re: Datagrid colour change
            Arun Lal

            <mx:DataGrid id="dg" dataProvider="{dgArr}" x="262" y="111">




                        <mx:DataGridColumn dataField="uid"/>


                        <mx:DataGridColumn dataField="value">






                                    <mx:TextArea height="22" selectable="false" creationComplete="init()" >






                                            private function init():void{


































                        import mx.collections.ArrayCollection;






                        private var dgArr:ArrayCollection = new ArrayCollection([{uid:"1",value:"100"},{uid:"2",value:"200"},{uid:"3",value:"140"},{uid:" 4",value:"320"},{uid:"5",value:"160"}]);






            • 4. Re: Datagrid colour change
              Balagopalr Level 1

              Thanks a lot.Worked Perfectly

              • 5. Re: Datagrid colour change
                Balagopalr Level 1


                The above code I used for a dynamic value.The colour in changing but not continuously as the value comes and goes above and below the value.So I tried to add an event listner.But its not working.Can u just say where to add code (listener) so that the colour changes continuously as value goes up an down the threshold value.

                • 6. Re: Datagrid colour change
                  Arun Lal Level 2

                  Write this also:



                  • 7. Re: Datagrid colour change
                    Balagopalr Level 1

                    updateComplete is not working.

                    Only initially the colour is changing.After that the colour is not changing as the value changes.