vertical text stacking in column headers

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

2 Replies

JA Janagan Syncfusion Team 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.





AC Andy Chan May 20, 2008 05:31 PM UTC

Thank you, this will work.


Loader.
Up arrow icon