3 Replies Latest reply on Oct 25, 2010 8:41 AM by jfb00

    Datagrid column header word wrap issue

    jfb00 Level 3

      Hi All,

      I'm passing dynamic text to a datagrid column header. The word wrap is true but it's not working.

      Any ideas how to fix this issue?

       

      DataGridColumn headerText="{myVar.text} Total" headerWordWrap="true"

       

      Thanks

      Johnny

        • 1. Re: Datagrid column header word wrap issue
          BhaskerChari Level 4

          @Johnny,

           

          Try to make use of the headerRenderer property and use <mx:Text /> control as a renderer so that your headerText gets wrapped..

           

           

          Thanks,

          Bhasker

           

          Message was edited by: BhaskerChari

          1 person found this helpful
          • 2. Re: Datagrid column header word wrap issue
            jfb00 Level 3

            Good idea:

            Here is my extended text component,but how do I pass the new value text to the component?

            <?xml version="1.0"?>
            <mx:Text xmlns:mx="http://www.adobe.com/2006/mxml">
                <mx:Script>
                    <![CDATA[
                        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                        {
                            textField.wordWrap =  true;
                            textField.text = "Sample Text";
                        }
                    ]]>
                </mx:Script>
            </mx:Text>

             

            Thanks Bhasker

             

            Johnny

            • 3. Re: Datagrid column header word wrap issue
              jfb00 Level 3

              Got it.. tks

               

              <?xml version="1.0"?>
              <mx:Text xmlns:mx="http://www.adobe.com/2006/mxml">
                  <mx:Script>
                      <![CDATA[
                          import mx.controls.dataGridClasses.DataGridColumn;
                             
                          override public function set data(value:Object):void{
                              var col:DataGridColumn = value as DataGridColumn;
                              textField.wordWrap =  true;
                              textField.text = col.headerText;
                          }
                      ]]>
                  </mx:Script>
              </mx:Text>