Version

Header Property (UltraGridGroup)

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
'Declaration
 
Public ReadOnly Property Header As GroupHeader
public GroupHeader Header {get;}
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.

Example
Following code shows how to create a group and shows some of the properties off the group.

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

  Private Sub Button121_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button121.Click

      ' Get the band to have the groups in.
      Dim band As UltraGridBand = Me.UltraGrid1.DisplayLayout.Bands(0)

      ' Clear existing groups if any.
      band.Groups.Clear()

      ' Add a group with the key of G1 and the caption of Address Info.
      band.Groups.Add("G1", "Address Info")

      ' Add some columns to the group.
      band.Groups("G1").Columns.Add(band.Columns("CustomerID"), 0)
      band.Groups("G1").Columns.Add(band.Columns("ContactName"), 1)
      band.Groups("G1").Columns.Add(band.Columns("City"), 2)
      band.Groups("G1").Columns.Add(band.Columns("Region"), 3)
      band.Groups("G1").Columns.Add(band.Columns("Country"), 4)

  End Sub

  Private Sub Button120_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button120.Click

      Dim group As UltraGridGroup = Me.UltraGrid1.DisplayLayout.Bands(0).Groups("G1")

      ' Set Width to 600. Extent property returns the same value as Width but unlike 
      ' Width, Extent is read-only.
      group.Width = 600
      Debug.WriteLine("Group width = " & group.Width & ", Extent = " & group.Extent)

      ' Set the appearance of the group header.
      group.Header.Appearance.BackColor = Color.Red

      ' You can change the caption by setting the caption.
      group.Header.Caption = "Group Caption"

      ' You can also set the appearance of cells in columns that belong to this group.
      group.CellAppearance.BackColor = Color.LightSkyBlue

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

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

	// Get the band to have the groups in.
	UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0];
	 		
	// Clear existing groups if any.
	band.Groups.Clear( );
	 	
	// Add a group with the key of G1 and the caption of Address Info.
	band.Groups.Add( "G1", "Address Info" );

	// Add some columns to the group.
	band.Groups["G1"].Columns.Add( band.Columns["CustomerID"],    0 );
	band.Groups["G1"].Columns.Add( band.Columns["ContactName"],   1 );
	band.Groups["G1"].Columns.Add( band.Columns["City"],          2 );
	band.Groups["G1"].Columns.Add( band.Columns["Region"],        3 );
	band.Groups["G1"].Columns.Add( band.Columns["Country"],       4 );

}

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

	UltraGridGroup group = this.ultraGrid1.DisplayLayout.Bands[0].Groups["G1"];

	// Set Width to 600. Extent property returns the same value as Width but unlike 
	// Width, Extent is read-only.
	group.Width = 600;
	Debug.WriteLine( "Group width = " + group.Width + ", Extent = " + group.Extent );

	// Set the appearance of the group header.
	group.Header.Appearance.BackColor = Color.Red;

	// You can change the caption by setting the caption.
	group.Header.Caption = "Group Caption";

	// You can also set the appearance of cells in columns that belong to this group.
	group.CellAppearance.BackColor = Color.LightSkyBlue;

}
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