Remove Method - TreeView Node

Removes the specified node from the TreeView's Nodes collection.

Client support

   Newlook Smartclient only.

Syntax

App.ActiveForm.TreeViewControl.Nodes.Remove(Index)

Parameters

Index – (Integer, Required)

The key of the node to be removed.

Returns

Returns a Boolean indicating the success or failure of the action.

Use

If the node that is removed has children, then these nodes will be removed as well.

Examples

The following example will remove the node with the key "M2A" from the tree view control:

JSCRIPT

function RemoveNodeByKey()

{

//Remove the dynamically inserted node via its key

removeSuccess = App.ActiveForm.tvOrgChart.Nodes.Remove("M2A");

App.SetValue("RemoveSuccess", removeSuccess);

}

function RemoveClickedNode()

{

//Remove the last clicked node

vLastClickedNode = App.ActiveForm.tvOrgChart.LastClickedNode.Key;

removeSuccess = App.ActiveForm.tvOrgChart.Nodes.Remove(vLastClickedNode);

}

VB SCRIPT

Sub RemoveNode

  'Remove the specified node

   App.ActiveForm.tvOrgChart.Nodes.Remove "M2A"

End Sub

See Also

Add Method - Nodes | Clear Method | RefreshForm method

Applies To

TreeView Nodes collection


© 2004-2021 looksoftware. All rights reserved.