Couldn't find an answer to this, sorry in advance if it's already answered!
I want to make my ultragrid column headers multiline, then wordwrap the header text over these lines. So far I have found .DisplayLayout.Bands(0).ColHeaderLines = 2 which gives me 2 lines but can see how to wordwrap the text over these 2 lines.
ie instead of "Customer Name" you would have
"Customer
Name"
Thanks
Hi,
If you want to control where the text breaks, then you would change the caption on the column to include a line break.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; band.ColHeaderLines = 2; band.Columns["Customer Name"].Header.Caption = "Customer " + Environment.NewLine + "Name"; }
If you want the grid to just wrap the text whenever needed based on the width of the column, and you don't particularly care where the text breaks, you could do this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; UltraGridOverride ov = layout.Override; ov.WrapHeaderText = DefaultableBoolean.True; band.Columns["Customer Name"].Header.Caption = "Customer Name"; }
sorry for the confusion. It works of course, but our localization kicked in and text from the resources were used instead of my (identical) text... ;)
Thanks BR Florian
They both work fine for me (Environment.NewLine and "\n").
I'm attaching a sample demonstrating this.