We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Header with Vertical Text

Thread ID:





43706 May 1,2006 03:34 PM UTC Oct 6,2006 04:38 AM UTC WinForms 4
Tags: GridControl
Pierre-Luc Boulet
Asked On May 1, 2006 03:34 PM UTC

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!

Administrator [Syncfusion]
Replied On 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

Pierre-Luc Boulet
Replied On 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!

Aaron Andreson
Replied On 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.

Administrator [Syncfusion]
Replied On 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



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon