Version

ColHeaderLines Property

Returns or sets the number of lines to display for column headers.
Syntax
'Declaration
 
Public Property ColHeaderLines As Integer
public int ColHeaderLines {get; set;}
Remarks

The ColHeaderLines property determines how many lines of text can appear inside of a column header. Setting the value of this property will change the height of the column headers to accommodate the specified number of lines, whether or not any column header actually contains enough text to fill multiple lines. The minimum value for this property is 1.

If you want the UltraGrid to automatically wrap the header caption and also change the height of the headers to accomodate wrapped header caption, then set the UltraGridOverride.WrapHeaderText to True.

Pixel level control over the heights of headers can be achieved using the Row-Layout functionality. See UseRowLayout for more information.

Example
Following code illustrates how one can use ColHeaderLines and GroupHeaderLines properties to show multiline captions in the group and column headers.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button26_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button26.Click

      Dim band As UltraGridBand = Me.ultraGrid1.DisplayLayout.Bands(0)

      ' Set a column's and group's headers' captions to a multi-line text.
      band.Columns(0).Header.Caption = "Line 1" & vbCrLf & "Line 2"

      ' Assuming you have added groups to the band, set first group's header's Caption 
      ' to a multiline text.
      band.Groups(0).Header.Caption = "Multiline" & vbCrLf & "Group Header"

      ' To accomodate the multiline captions, set the ColHeaderLines and 
      ' GroupHeaderLines to 2.
      band.ColHeaderLines = 2
      band.GroupHeaderLines = 2

  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button26_Click(object sender, System.EventArgs e)
{

	UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0];
 	
	// Set a column's and group's headers' captions to a multi-line text.
	band.Columns[0].Header.Caption = "Line 1\nLine 2";
	
	// Assuming you have added groups to the band, set first group's header's Caption 
	// to a multiline text.
	band.Groups[0].Header.Caption = "Multiline\nGroup Header";
 			
	// To accomodate the multiline captions, set the ColHeaderLines and 
	// GroupHeaderLines to 2.
	band.ColHeaderLines = 2;
	band.GroupHeaderLines = 2;

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also