I'm using NetAdvantage Win Client 2008 Vol 3.
I have read through the help files and the WinGrid forum and tried the code suggested; however, I am not able to control specifically where the line break occurs. The only method that does give me multi-lined header captions is to set the WrapHeaderText property to true and supply enough spaces between text to hopefully get the wrap to occur where I desire.
Examples of what I have tried:
In Code...
UltraGridBand band = this.gridSelect.DisplayLayout.Bands[0]; band.Columns[0].Header.Caption = "Federal" + Environment.NewLine + "RUG";
and Designer
Header | Caption = Federal\nRUG
Is there a trick I am missing?
Thx,
Set WrapHeaderText to false.
Set ColHeaderLines to the number of lines you need to display the largest column caption.
Then you can set the caption of a column to include a NewLine (like you have here) and it will be honored.
Thx Mike. It was honored using the inline code in the InitializeLayout event method.
However, for some reason putting the \n or \r\n in the column Header.Caption property via designer did not work. I inspected the Header.Caption property at runtime when added via designer was actually \\n or \\r\\n.
Oh well... got it to do what I want. :-) Thx!
The designer probably assumes that anything you type into a property at design-time is meant as a literal and escapes it for you. So you have to do this at run-time.