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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

vertical text stacking in column headers

Thread ID:

Created:

Updated:

Platform:

Replies:

73039 Apr 16,2008 05:49 PM UTC May 20,2008 05:31 PM UTC WinForms 2
loading
Tags: GridControl
Andy Chan
Asked On April 16, 2008 05:49 PM UTC

Hello,

I'm looking for a way to stack my text in a column header. I've attached a picture of what it should look like... is there an easy way to accomplish this through the grid properties? Thanks in advance.

Andy.



col_stackedheader.zip

Janagan [Syncfusion]
Replied On May 12, 2008 01:29 PM UTC

Hi Andy,

You can align the text one below the other in the column header by the following code below:



private void gridControl1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if ((e.ColIndex == 1) && (e.RowIndex == 0))
{
e.Style.Font.Italic = true;
e.Style.Font.Bold = true;
e.Style.Font.Size = 10;

e.Style.TextColor = Color.Red;
e.Style.FormattedText = " C" + Environment.NewLine + " o" + Environment.NewLine + "n " + Environment.NewLine + "t";
}
}




Please refer the sample in the link below which illustrates the above:

http://websamples.syncfusion.com/samples/Grid.Windows/Grid_Windows_stackedtext/main.htm


Please try running this and let me know if this helps.

Thanks,
Janagan.




Andy Chan
Replied On May 20, 2008 05:31 PM UTC

Thank you, this will work.


CONFIRMATION

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.

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

;