Skip navigation
andrew23121988
Currently Being Moderated

Rotate HeaderText in DataGrid

May 5, 2012 10:19 AM

Tags: #flex #datagrid #rotating #headertext

Hello!

I got many letters in headerText of DataGridColumn. Can anyone help me with this problem?

1) Maybe someone know how works rotating()? This problem was discussed here http://tech.groups.yahoo.com/group/flexcoders/message/62230. But this method doesn't work.

2) Or is it possible to enter several strings to headerText with '\n' between them? 'cause we can always make headerHeight as big as we need to.

Here is a code of mine

 

<fx:Style>

     @font-face {

          src:url("assets/verdanab.ttf");

          fontFamily: "MyFont";

          fontWeight: bold;

       }

     .myStyle1{

          fontFamily:"MyFont";

          fontSize:12pt;

     }

</fx:Style>

<mx:DataGrid id="myGrid2" x="91" y="526" height="100" dataProvider="{initDG2}" editable="true"

           variableRowHeight="true" maxHeight="150" headerHeight="60">

      <mx:columns>

           <mx:DataGridColumn dataField="Field1" width="150" headerText="Very long text"/>

           <mx:DataGridColumn dataField="Field2" headerText="Very long text">

                <mx:headerRenderer>

                     <fx:Component>

                          <mx:VBox horizontalAlign="center">

                               <mx:Text text="{this.headerText.data}" styleName=".myStyle1" rotation="90"/>   

                          </mx:VBox>

                     </fx:Component>

                </mx:headerRenderer>

           </mx:DataGridColumn>

 

      </mx:columns>

</mx:DataGrid>

 

Sorry for my bad English. And thanks in advance.

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points