5 Replies Latest reply on Apr 20, 2011 9:45 AM by Flex harUI

    How to set a variableRowHeight and a fontWeight in a DataGrid row

    Michel Reynard

      Hi,

       

      I'd like to set the variableRowHeight of a DataGrid

       

      <mx:DataGrid variableRowHeight="true"

       

      and then set a conditional font weight of the row with an item renderer

       

      <mx:DataGridColumn itemRenderer="com.MyRenderer" wordWrap="true"

       

       

      with the following renderer

       

      override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
      super.updateDisplayList(unscaledWidth, unscaledHeight);
      this.setStyle("fontWeight", (this.data.isBold) ? "normal" : "bold");
      }

       

       

      The problem is that the renderer override the wordWrap option.

       

      Is it possible to set the wordWrap from the renderer?

      How can I have the both options working (wordWrap & conditional fontWeight)?