System.Web.UI.WebControls.TreeNodeCollection.RemoveAt Method

Removes the System.Web.UI.WebControls.TreeNode object at the specified index location from the System.Web.UI.WebControls.TreeNodeCollection object.

Syntax

public void RemoveAt (int index)

Parameters

index
The zero-based index location of the node to remove.

Remarks

Use the TreeNodeCollection.RemoveAt(int) method to remove the System.Web.UI.WebControls.TreeNode object at the specified zero-based index location from a System.Web.UI.WebControls.TreeNodeCollection. All items that follow that node are then moved up to fill in the vacant position. The indexes of the moved items are also updated.

Note:

The System.Web.UI.WebControls.TreeNodeCollection can contain null references (Nothing in Visual Basic), as well as duplicate System.Web.UI.WebControls.TreeNode objects.

As an alternative, you can remove a specific System.Web.UI.WebControls.TreeNode object by using the TreeNodeCollection.Remove(TreeNode) method. You can also remove every node in the collection by using the TreeNodeCollection.Clear method.

Requirements

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