System.Web.UI.WebControls.TreeNode.Collapse Method

Collapses the current tree node.

Syntax

public void Collapse ()

Remarks

Use the TreeNode.Collapse method to conveniently collapse the current node.

Note:

As an alternative, you can also set the TreeNode.Expanded property to false.

To collapse the current node and all its child nodes, consider using the TreeNode.CollapseAll method.

TreeView.CollapseAll will collapse all the nodes in the entire tree.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0