バージョン

Level プロパティ

列が常駐しているバンドのレベルを設定します。
シンタックス
'宣言
 
Public Property Level As Integer
public int Level {get; set;}
解説

通常、バンドの各データ レコードは、すべてのセルは左から右に伸びたグリッドの一行を使用します。環境によっては、単一のレコードで複数列を使用したい場合があります。たとえば、レコード内にアドレス データを保存した場合、最初のレベル上に名前と姓のフィールド、2 番目のレベルに住所、3 番目のレベルに市、州、郵便番号を保存したいとします。LevelCount プロパティは、どの程度のデータ レベルでバンドがデータソースの各レコードを表示するかを指定するために使用されます。Level プロパティは、バンドのどのレベルが列を占有するかを決定するために使用されます。

レベルは、バンド内のフィールド ブロックを作成するためにグリッドと連動します。バンドで指定されているグループがなければ、Level プロパティは効果がありません。ひとつ以上のグループが指定される(グループまたはバンド内で列移動が有効に設定される)場合、列ヘッダーを異なるレベルにドラッグすることによって、グループ内でフィールドを垂直に並べ直すことができます。

このプロパティは 0 で始まり、バンドの最初のレベルに列が置かれることを指定するには、このプロパティを 0 に設定します。

使用例
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;

}
参照