Header with Vertical Text

Hello, I would like to know if there is a way to make a header cell to display it''s text vertically, meaning you''d have to bend your neck to the left to read the text correctly. That would be in order to make the grid higher rather than large. Thanks!

4 Replies

AD Administrator Syncfusion Team May 2, 2006 04:02 AM UTC

Hi Pierre, You need to set the Font''s Orientation property to display the text vertically.Here is a code snippet. this.gridDataBoundGrid1.BaseStylesMap["Column Header"].StyleInfo.Font.Orientation = 90; Please let me know if this helps. Thanks for choosing Syncfusion Products. Regards, Haneef


PB Pierre-Luc Boulet May 2, 2006 01:03 PM UTC

I wanted it the other way around, but.... I get the point ;) 270 degrees works :P Thanks a lot!


AA Aaron Andreson October 5, 2006 06:23 PM UTC

How would I go about changing the text orientation for only certain column headers?

>Hi Pierre,
>
>You need to set the Font''s Orientation property to display the text vertically.Here is a code snippet.
>
>this.gridDataBoundGrid1.BaseStylesMap["Column Header"].StyleInfo.Font.Orientation = 90;
>
>Please let me know if this helps.
>
>Thanks for choosing Syncfusion Products.
>Regards,
>Haneef


AD Administrator Syncfusion Team October 6, 2006 04:38 AM UTC

Hi Aaron,

You can do this by handling Model.QueryCellInfo or PrepareviewStyleInfo. By default, DataBoundGrid doesn''t store any style info properties. You can not set any cell or row specific properties for the DataBoundGrid other than the CellValue.You need to handle the PrepareViewStyleInfo (or Model.QueryCellInfo) Event to do this.Through this event you can set the style properties for the grid.

To set the Orientation for a column header cell, you check for the e.Style.CellType/e.Style.Text, if that points to the cell you desired, set the e.Style.Font.Orientation for it.

private void Model_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
{
if( e.Style.CellType == "ColumnHeaderCell" && e.Style.Text == "ColumnHeaderTextName")
{
e.Style.Font.Orientation = 270;
}
}

See the KnowledgeBase Articles for more info.
QueryCellInfo event : http://www.syncfusion.com/Support/article.aspx?id=10351
PrepareViewStyleInfo event :http://www.syncfusion.com/Support/article.aspx?id=560

Regards,
Haneef

Loader.
Up arrow icon