Collapses every row in the band and discards all of the expand/collapse information for the child rows.
Following code illustrates how ExpandAll and CollapseAll methods off the UltraGridRow work. It expands and collapses the active row (or the first row if there is no active row) on successive button clicks.
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Private toggleFlag As Boolean = False
Private Sub Button109_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button109.Click
Dim row As UltraGridRow = Me.UltraGrid1.ActiveRow
' If there is no active row, then use the first row.
If row Is Nothing Then
row = Me.ultraGrid1.Rows(0)
End If
' Toggle the flag.
Me.toggleFlag = Not Me.toggleFlag
If Me.toggleFlag Then
' Call ExpandAll to expand the row and it's descendant rows recursively.
row.ExpandAll()
Else
' Call CollapseAll to collapse the row and it's descendant rows recursively.
row.CollapseAll()
End If
End Sub
'Declaration
Public Sub CollapseAll()
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;
private bool toggleFlag = false;
private void button109_Click(object sender, System.EventArgs e)
{
UltraGridRow row = this.ultraGrid1.ActiveRow;
// If there is no active row, then use the first row.
if ( null == row )
row = this.ultraGrid1.Rows[0];
// Toggle the flag.
this.toggleFlag = !this.toggleFlag;
if ( this.toggleFlag )
{
// Call ExpandAll to expand the row and it's descendant rows recursively.
row.ExpandAll( );
}
else
{
// Call CollapseAll to collapse the row and it's descendant rows recursively.
row.CollapseAll( );
}
}
'Declaration
Public Sub CollapseAll()
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