Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > GridView > How do I rotate a column header's text?

Not answered How do I rotate a column header's text?

Feed from this thread
  • Posted on Apr 7, 2008 (permalink)

    I've got a grid consisting of many checkboxes with long column headers. How would I go about making my column headers be vertically aligned?

    It needs to be a long first column with a long name in the first column of each row, and then the 2nd to 10th column are all booleans with long column header names (eg. "20mm Pencil Round"). I'd like to get my cell size to be just slightly larger than the checkbox, both length and width.

    How would I accomplish this?

    Reply

  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Apr 8, 2008 (permalink)

    Hi Pawz,

    Thank you for writing.

    Currently, RadGridView does not support changing the orientation of header cells text. We will consider adding this feature in one of our future releases.

    If you have other questions do not hesitate to contact me again.

    Best wishes,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

  • Ben avatar

    Posted on Feb 11, 2009 (permalink)

    Hi Martin,

    I also need a rotation option for the column header text. Does it exist already or is it scheduled for a future release?

    Thanks,

    Ben

    Reply

  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Feb 16, 2009 (permalink)

    Hi Ben,

    Thank you for contacting me.

    We are still working on the feature and the good news is that we will try to include it in our upcoming release Q1 2009. Do not hesitate to contact me again if you have other questions.

    Best wishes,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Ben avatar

    Posted on Mar 3, 2009 (permalink)

    Hi Martin,

    Do you already know if the requested feature is available in the Q1 2009 release of the WinForms and AJAX controls?
    And do you have a sample/preview/demo for me?

    Thanks, Ben

    Reply

  • Yavor Yavor admin's avatar

    Posted on Mar 6, 2009 (permalink)

    Hello Ben,

    Thank you for the questions.

    The good news is that in the upcoming Q1 2009 release,  we will include vertical header text feature for RadGridView  for WinForms. It is still too early to prepare an example, but we will make one as soon as the release is available.

    With respect to the Ajax controls. This behavior can be achieved via custom css code. The idea is basically to alter the css for the header, and make it rotate vertically. More information on this is available in the following article.

    Greetings,
    Yavor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Ben avatar

    Posted on Aug 17, 2009 (permalink)

    Hi there,

    Could you please send me a winforms example and a AJAX example? We are currently evaluation what next step
    we have to make. Please respond on my e-mail adress.

    Thanks,

    Ben

    Reply

  • Yavor Yavor admin's avatar

    Posted on Aug 19, 2009 (permalink)

    Hi Ben,

    Please follow the provided link in the previous post about ASP.NET AJAX.

    For WinForms, you can use the following code snippet:

    private void Form5_Load(object sender, EventArgs e) 
            { 
                this.radGridView1.Columns.Add(new GridViewTextBoxColumn("ABCDEFGH")); 
                this.radGridView1.GridElement.TableHeaderHeight = 90; 
            } 
     
            private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) 
            { 
                GridHeaderCellElement element = sender as GridHeaderCellElement; 
                if (element != null
                { 
                    element.TextOrientation = Orientation.Vertical;   
                } 
            } 

    Additionally, you can set the orientation of the header via the following css attributes:

     {
    writing-mode: tb-rl;
    filter: flipv fliph;
    }

    I hope this helps.

    All the best,
    Yavor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Peter Woodward avatar

    Posted on May 27, 2010 (permalink)

    We are using the 2010 version, so I assume you have a solution for rotating the header now? :)

    Reply

  • Bruno Intermediate avatar

    Posted on May 28, 2010 (permalink)

    hi

    this is bruno

    We using Jquery because problem with diferent browsers

    http://stackoverflow.com/questions/278940/vertical-text-with-jquery

    http://pupunzi.com/#mb.components/mb.flipText/flipText.html

    tahnks

    Reply

  • Gunbilegt avatar

    Posted on May 1, 2011 (permalink)

    May 1st 2011. Do you support vertical text now?

    Reply

  • Posted on May 1, 2011 (permalink)

    Hello,

    If you are talking about WinForms, it does rotate the text, you can follow the code snippet provided by Yavor.

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga

    Telerik WinForms MVP

    Reply

  • Gunbilegt avatar

    Posted on May 1, 2011 (permalink)

    Nope I was talking about Asp.Net Ajax RadGrid.

    I went to following link but guy linked to this topic So I assumed it was Ajax Forum. Sorry for posting in wrong forum. But can you answer to this question in Ajax forum.
    http://www.telerik.com/community/forums/aspnet-ajax/grid/vertical-column-headers.aspx

    Reply

  • Tsvetina Tsvetina admin's avatar

    Posted on May 5, 2011 (permalink)

    Hello Gunbilegt,

    RadGrid does not offer this feature by default, so you would need to use a custom approach in order to achieve such look.

    A few of the previous posts in this thread discuss possible options with jQuery or CSS.

    Regards,
    Tsvetina
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

    Reply

  • Jose Luis Torres Calderon avatar

    Posted on Jun 14, 2011 (permalink)

    Hi, I can´t rotate the header text even with the given snippet, some one can help me please?

    Thanks

    Reply

  • Michael avatar

    Posted on Dec 12, 2011 (permalink)

    I too have been trying to get this feature working. Kind of expected it to have been implemented by now as it has been outstanding since 2008.  Ill look into the jquery or css options... 

    Reply

  • Tsvetina Tsvetina admin's avatar

    Posted on Dec 14, 2011 (permalink)

    Hi Michael,

    You could submit this as a Feature Request, so that it gets to our developers and they consider it for implementation. Until now it has not been submitted as a request by anyone and having in mind that this thread was originally posted in the WinForms forums, the discussion has not been well visible to the ASP.NET AJAX developement team.

    Greetings,
    Tsvetina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

    Reply

  • Andy avatar

    Posted on Feb 3, 2012 (permalink)

    Make sure that you add the code in Yavor's snippet to the ViewCellFormatting event and not the CellFormatting event of the GridView.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > GridView > How do I rotate a column header's text?
Related resources for "How do I rotate a column header's text?"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]