Version

Item(String) Property

indexer (by string key)
Syntax
'Declaration
 
Public Overloads ReadOnly Property Item( _
   ByVal key As String _
) As UltraGridColumn
public UltraGridColumn Item( 
   string key
) {get;}

Parameters

key
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