Version

ExpandAll(ExpandAllType) Method

Expands this node and all of its descendants.
Syntax
'Declaration
 
Public Overloads Sub ExpandAll( _
   ByVal expand As ExpandAllType _
) 
public void ExpandAll( 
   ExpandAllType expand
)

Parameters

expand
Determines whether the method will take the existence of child nodes into consideration before expanding the node.
Remarks

When called with Always, this method expands each node by setting the Expanded proeprty to true. The node expansion may still be cancelled in the UltraTree.BeforeExpand event."

If the node's ShowExpansionIndicator property is set to CheckOnExpand, the BeforeExpand event will fire normally and if nodes are added (or already present) the node will expand. If no children are present after the completion of the BeforeExpand event, the node will not expand and the expansion indicator will disappear as normal.

Example
The following code illustrates how to toggle the expanded state of nodes.

Imports Infragistics.Win.UltraWinTree

Private Sub button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button11.Click

    Dim node As UltraTreeNode

    node = Me.ultraTree1.ActiveNode

    If node Is Nothing Then Return

    ' toggle the expansion state of this node and all its
    ' descendant nodes.
    If node.Expanded = True Then
        node.CollapseAll()
    Else
        node.ExpandAll(ExpandAllType.OnlyNodesWithChildren)
    End If

    ' Note: The following code toggles the expansion state
    ' of this node only (not all of its descendant nodes):
    'node.Expanded = Not node.Expanded

    ' Note: To expand or collapse all of the nodes in the
    ' tree use the control's 'ExpandAll' or 'CollapseAll'.
    ' The following code illustrates:
    'Me.ultraTree1.ExpandAll(ExpandAllType.OnlyNodesWithChildren)
    'Me.ultraTree1.CollapseAll()

End Sub
using Infragistics.Win.UltraWinTree;

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

	UltraTreeNode node = this.ultraTree1.ActiveNode;
		
	if ( node == null )
		return;

	// toggle the expansion state of this node and all its
	// descendant nodes.
	if ( node.Expanded == true )
		node.CollapseAll();
	else
		node.ExpandAll( ExpandAllType.OnlyNodesWithChildren );

	// Note: The following code toggles the expansion state
	// of this node only (not all of its descendant nodes):
	//node.Expanded = !node.Expanded;


	// Note: To expand or collapse all of the nodes in the
	// tree use the control's 'ExpandAll' or 'CollapseAll'.
	// The following code illustrates:
	//this.ultraTree1.ExpandAll( ExpandAllType.OnlyNodesWithChildren );
	//this.ultraTree1.CollapseAll();

}
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