How do I rotate a column header's text?

19 posts, 0 answers
  1. Pawz
    Pawz avatar
    51 posts
    Member since:
    Aug 2007

    Posted 07 Apr 2008 Link to this post

    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?
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 08 Apr 2008 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ben
    Ben avatar
    4 posts
    Member since:
    Sep 2008

    Posted 11 Feb 2009 Link to this post

    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
  5. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 16 Feb 2009 Link to this post

    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.
  6. Ben
    Ben avatar
    4 posts
    Member since:
    Sep 2008

    Posted 03 Mar 2009 Link to this post

    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
  7. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 06 Mar 2009 Link to this post

    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.
  8. Ben
    Ben avatar
    4 posts
    Member since:
    Sep 2008

    Posted 17 Aug 2009 Link to this post

    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
  9. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 19 Aug 2009 Link to this post

    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.
  10. Rob
    Rob avatar
    10 posts
    Member since:
    Oct 2004

    Posted 27 May 2010 Link to this post

    We are using the 2010 version, so I assume you have a solution for rotating the header now? :)
  11. Bruno
    Bruno avatar
    105 posts
    Member since:
    Mar 2008

    Posted 28 May 2010 Link to this post

    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
  12. Gunbilegt
    Gunbilegt avatar
    3 posts
    Member since:
    Dec 2010

    Posted 01 May 2011 Link to this post

    May 1st 2011. Do you support vertical text now?
  13. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 01 May 2011 Link to this post

    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
  14. Gunbilegt
    Gunbilegt avatar
    3 posts
    Member since:
    Dec 2010

    Posted 01 May 2011 Link to this post

    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
  15. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 05 May 2011 Link to this post

    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.

  16. Jose Luis Torres Calderon
    Jose Luis Torres Calderon avatar
    1 posts
    Member since:
    Nov 2009

    Posted 14 Jun 2011 Link to this post

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

    Thanks
  17. Michael
    Michael avatar
    31 posts
    Member since:
    Dec 2011

    Posted 12 Dec 2011 Link to this post

    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... 
  18. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 14 Dec 2011 Link to this post

    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
  19. Andy
    Andy avatar
    2 posts
    Member since:
    Aug 2011

    Posted 03 Feb 2012 Link to this post

    Make sure that you add the code in Yavor's snippet to the ViewCellFormatting event and not the CellFormatting event of the GridView.
  20. Axel
    Axel avatar
    1 posts
    Member since:
    May 2013

    Posted 06 Jun 2013 Link to this post

    ... deleted ...
Back to Top
UI for WinForms is Visual Studio 2017 Ready