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.
Unfortunately, activation email could not send to your email. Please try again.

vertical text stacking in column headers

Thread ID:

Created:

Updated:

Platform:

Replies:

73039 Apr 16,2008 01:49 PM May 20,2008 01:31 PM Windows Forms 2
loading
Tags: GridControl
Andy Chan
Asked On April 16, 2008 01:49 PM

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 09:29 AM

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 01:31 PM

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.

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.

;