Version

Level Property

Returns or sets the level of a band in which a column resides.
Syntax
'Declaration
 
Public Property Level As Integer
public int Level {get; set;}
Remarks

Typically, each data record in a band occupies a single row of the grid, with all of the cells stretching from left to right. In some circumstances, you may want to have a single record occupy more than one row. For example, if you have address data stored in a record, you may want to have the first and last name fields on one level, the street address on a second level, and city, state and postal code fields on a third level. The LevelCount property is used to specify how many levels of data a band will display for each record in the data source. The Level property is used to determine which level of the band a column occupies.

Levels work in conjunction with groups to create blocks of fields within a band. If you do not have any groups specified for a band, the Level property will have no effect. If one or more groups are specified (and column moving is enabled within the group or band) you can re-arrange fields vertically within the group by dragging their column headers to different levels.

This property is 0-based; to specify that a column should reside in the first level of a band, set this property to 0.

Example
Following code adds a group. It changes the levels of columns within the group by assigning the Level property of the columns.

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")

      ' Add some columns to the group.
      band.Groups("G1").Columns.Add(band.Columns("CustomerID"))
      band.Groups("G1").Columns.Add(band.Columns("ContactName"))

      ' Set the level count to 2.
      band.LevelCount = 2

      ' Set the level of ContactName column to the first level and CustomerID to the
      ' second level.
      band.Columns("ContactName").Level = 0
      band.Columns("CustomerID").Level = 1

  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" );

	// Add some columns to the group.
	band.Groups["G1"].Columns.Add( band.Columns["CustomerID"]  );
	band.Groups["G1"].Columns.Add( band.Columns["ContactName"] );

	// Set the level count to 2.
	band.LevelCount = 2;

	// Set the level of ContactName column to the first level and CustomerID to the
	// second level.
	band.Columns["ContactName"].Level = 0;
	band.Columns["CustomerID"].Level  = 1;

}
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