Infragistics(R) NetAdvantage(R) Windows Forms
HeaderBase Class
Members  Example  See Also  E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace : HeaderBase Class

Returns the Header object associated with the object. This property is read-only at run-time. This property is not available at design-time.

Syntax

Visual Basic (Declaration) 
Public MustInherit Class HeaderBase 
   Inherits GridItemBase
   Implements Infragistics.Shared.ISelectableItem, Infragistics.Win.IValueListOwner, Infragistics.Win.Layout.IGridBagConstraint, Infragistics.Win.Layout.ILayoutChildItem, Infragistics.Win.Layout.ILayoutItem, IProvideRowLayoutColumnInfo 
C# 
public abstract class HeaderBase : GridItemBase, Infragistics.Shared.ISelectableItem, Infragistics.Win.IValueListOwner, Infragistics.Win.Layout.IGridBagConstraint, Infragistics.Win.Layout.ILayoutChildItem, Infragistics.Win.Layout.ILayoutItem, IProvideRowLayoutColumnInfo  

Example

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

Visual BasicCopy Code
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
C#Copy Code
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;

}

Remarks

A Header object represents a column or group header that specifies information about the column or group, and can also serve as the interface for functionality such as moving, swapping or sorting the column or group. Group headers have the added functionality of serving to aggregate multiple columns under a single heading.

The Header property provides access to the header that is associated with an object. The Header property provides access to the header that is associated with an object. In some instances, the type of header may be ambiguous, such as when accessing the Header property of a UIElement object. You can use the Type property of the Header object returned by the Header property to determine whether the header belongs to a column or a group.

See Also