Parameters

Example

Following code shows how to expand or collapse all rows in a rows collection with ExpandAll and CollapseAll methods.

Visual Basic

Copy Code

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
PrivateSub CheckBox1_CheckedChanged(ByVal sender AsObject, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
IfMe.CheckBox1.Checked Then' Expand all the rows. You can pass in true to recursively expand all the
' descendant rows as well.
Me.UltraGrid1.Rows.ExpandAll(False)
Else' Collapse all the rows. You can pass in true to recursively collapse all the
' descendant rows as well.
Me.UltraGrid1.Rows.CollapseAll(False)
EndIfEnd Sub

C#

Copy Code

using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;
privatevoid checkBox1_CheckedChanged(object sender, System.EventArgs e)
{
if ( this.checkBox1.Checked )
{
// Expand all the rows. You can pass in true to recursively expand all the
// descendant rows as well.
this.ultraGrid1.Rows.ExpandAll( false );
}
else
{
// Collapse all the rows. You can pass in true to recursively collapse all the
// descendant rows as well.
this.ultraGrid1.Rows.CollapseAll( false );
}
}