バージョン

Expanded プロパティ (UltraGridRow)

行が展開されるかどうかを取得または設定します。このプロパティは設計時には使用できません。
シンタックス
'宣言
 
Public Property Expanded As Boolean
public bool Expanded {get; set;}
解説

このプロパティを False に設定すると、行は縮小されますが、子行の展開/縮小情報は破棄されません。UltraGridBand オブジェクトの Expandable プロパティが False の場合にこのプロパティを True に設定すると、エラーが発生します。

グリッドまたは特定の行コレクションのすべての行を展開または縮小するには、RowsCollection の RowsCollection.ExpandAll メソッドと RowsCollection.CollapseAll メソッドを使用します。

使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub Button54_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button54.Click

       Dim row As UltraGridRow = Me.UltraGrid1.Rows(0)

       ' Check to see if the row is expandable which depends on factors like whether
       ' the row has any child rows and whether the band associated with it is expandable.
       ' Return if the row is not expandable
       If Not row.IsExpandable Then
           Return
       End If

       ' Toggle the row's expanded status.
       If Not row.Expanded Then
           ' Set the Expanded to true to expand the row.
           row.Expanded = True
       Else
           ' Set the Expanded to false to collapse the row.
           row.Expanded = False
       End If

       ' IsExpanded property indicates whether the row is actually expanded. For example, If you
       ' were to set Expanded to true on a row that wasn't expandable (ie IsExpandable returned
       ' false), Expanded property would return true even thought the row wasn't actually expanded.
       ' However IsExpanded would rerturn false indicating the true status of the row's expansion
       ' status.
       Debug.WriteLine("Is row actually expanded ? " & row.IsExpanded)

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

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

	UltraGridRow row = this.ultraGrid1.Rows[0];

	// Check to see if the row is expandable which depends on factors like whether
	// the row has any child rows and whether the band associated with it is expandable.
	// Return if the row is not expandable
	if ( !row.IsExpandable )				
		return;

	// Toggle the row's expanded status.
	if ( !row.Expanded )
	{
		// Set the Expanded to true to expand the row.
		row.Expanded = true;
	}
	else
	{
		// Set the Expanded to false to collapse the row.
		row.Expanded = false;
	}

	// IsExpanded property indicates whether the row is actually expanded. For example, If you
	// were to set Expanded to true on a row that wasn't expandable (ie IsExpandable returned
	// false), Expanded property would return true even thought the row wasn't actually expanded.
	// However IsExpanded would rerturn false indicating the true status of the row's expansion
	// status.
	Debug.WriteLine( "Is row actually expanded ? " + row.IsExpanded );

}
参照