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

Rotate a vertical column header by 108 degrees

3 Answers 197 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 17 Apr 2011, 07:43 PM
Is there a way to rotate the text of the column header by 180 degrees when it is set to vertical?

What I mean by this is that I have my column headers set to vertical, but the text is written from top down, and I would like it to be written from the bottom up.

Thanks.

EDIT: The title should read 180 degrees

3 Answers, 1 is accepted

Sort by
0
Don
Top achievements
Rank 1
answered on 18 Apr 2011, 10:32 PM
I have no idea if this would work, but have you tried setting the text to Right-to-Left and then making it vertical?
0
Edward
Top achievements
Rank 1
answered on 19 Apr 2011, 12:20 AM
There is not right to left property for the header, besides, I think that would just align the text on the bottom, I need the text rotated as well.

Thanks for the idea though!
0
Richard Slade
Top achievements
Rank 2
answered on 19 Apr 2011, 10:18 AM
Hi Guys,

To do this you can use the flip text property of the element. E.g.

public Form1()
{
    InitializeComponent();
    this.radGridView1.GridElement.TableHeaderHeight = 90;
    this.radGridView1.ViewCellFormatting += new CellFormattingEventHandler(radGridView1_ViewCellFormatting);
}
void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
    GridHeaderCellElement element = sender as GridHeaderCellElement;
    if (element != null)
    {
        element.TextOrientation = Orientation.Vertical;
        element.FlipText = true;
    }  
}

Hope that helps but let me know if you need more information
RIchard
Tags
GridView
Asked by
Edward
Top achievements
Rank 1
Answers by
Don
Top achievements
Rank 1
Edward
Top achievements
Rank 1
Richard Slade
Top achievements
Rank 2
Share this question
or