0 Replies Latest reply on Apr 27, 2007 6:01 AM by JoBone00

    DataGrid - ItemRenderer - WordWrap

    JoBone00
      I have added an itemrenderer to a datagrid to change the color of individual rows based on the value of of a cell. However, the problem I am having is this. The word-wrap no longer works for the datagrid. I imagine this is because I use a lable in my itemrenderer. I have not been able to find just a good solution that makes the cells look just like the normal datagrid, but with different colors.

      Any suggestions would be greatly appreciated.

      Enclosed is the itemrenderer

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Label xmlns:mx=" http://www.adobe.com/2006/mxml" >

      <mx:Script>
      <![CDATA[
      import mx.controls.listClasses.ListData;


      import com.vo.HistoryDataValueObject;
      import com.model.Model;

      override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
      {
      super.updateDisplayList(unscaledWidth,unscaledHeight);
      if (data != null && (data is HistoryDataValueObject) )
      {
      if (data.monetaryAmount.indexOf("-",0) == data.monetaryAmount.length-1 )
      {
      setStyle("color", 0xFF0000);
      }
      else
      {
      setStyle("color", 0x000000);
      }
      }
      }
      ]]>
      </mx:Script>
      </mx:Label>