This is a migrated thread and some comments may be shown as answers.

How do I rotate a column header's text?

18 Answers 747 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pawz
Top achievements
Rank 1
Pawz asked on 07 Apr 2008, 08:32 AM
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?

18 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 08 Apr 2008, 11:02 AM
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
0
Ben
Top achievements
Rank 1
answered on 11 Feb 2009, 01:43 PM
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
0
Martin Vasilev
Telerik team
answered on 16 Feb 2009, 10:29 AM
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.
0
Ben
Top achievements
Rank 1
answered on 03 Mar 2009, 09:11 AM
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
0
Yavor
Telerik team
answered on 06 Mar 2009, 07:54 AM
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.
0
Ben
Top achievements
Rank 1
answered on 17 Aug 2009, 12:05 PM
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
0
Yavor
Telerik team
answered on 19 Aug 2009, 01:01 PM
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.
0
Rob
Top achievements
Rank 1
answered on 27 May 2010, 02:59 PM
We are using the 2010 version, so I assume you have a solution for rotating the header now? :)
0
Bruno
Top achievements
Rank 2
answered on 28 May 2010, 07:18 PM
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
0
Gunbilegt
Top achievements
Rank 1
answered on 01 May 2011, 10:37 AM
May 1st 2011. Do you support vertical text now?
0
Emanuel Varga
Top achievements
Rank 1
answered on 01 May 2011, 11:02 AM
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
0
Gunbilegt
Top achievements
Rank 1
answered on 01 May 2011, 11:07 AM
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
0
Tsvetina
Telerik team
answered on 05 May 2011, 08:01 AM
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.

0
Jose Luis Torres Calderon
Top achievements
Rank 1
answered on 14 Jun 2011, 07:43 PM
Hi, I can´t rotate the header text even with the given snippet, some one can help me please?

Thanks
0
Michael
Top achievements
Rank 1
answered on 12 Dec 2011, 05:15 PM
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... 
0
Tsvetina
Telerik team
answered on 14 Dec 2011, 11:24 AM
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
0
Andy
Top achievements
Rank 1
answered on 03 Feb 2012, 12:54 PM
Make sure that you add the code in Yavor's snippet to the ViewCellFormatting event and not the CellFormatting event of the GridView.
0
Axel
Top achievements
Rank 1
answered on 06 Jun 2013, 08:38 PM
... deleted ...
Tags
GridView
Asked by
Pawz
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Ben
Top achievements
Rank 1
Yavor
Telerik team
Rob
Top achievements
Rank 1
Bruno
Top achievements
Rank 2
Gunbilegt
Top achievements
Rank 1
Emanuel Varga
Top achievements
Rank 1
Tsvetina
Telerik team
Jose Luis Torres Calderon
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Andy
Top achievements
Rank 1
Axel
Top achievements
Rank 1
Share this question
or