RadTreeView for ASP.NET AJAX

RadControls for ASP.NET AJAX

The table below lists the most important functions of the client-side RadTreeNodeCollection object. The RadTreeNodeCollection object can be accessed using the RadTreeView get_nodes() function.

Name Parameters Return Type Description
addRadTreeNodenoneAdds a child Node to the Nodes collection of a Node.
CopyJavaScript
        function AddNode() {
            var tree = $find("<%= RadTreeView1.ClientID %>");
            tree.trackChanges();
            var node = new Telerik.Web.UI.RadTreeNode();
            node.set_text("New Node");
            tree.get_nodes().add(node);
            tree.commitChanges();
        }        
insertint, RadTreeNodenoneInserts a Node at the position defined by the first (index) parameter. The Node is inserted in the Nodes collection of a Node.
CopyJavaScript
        function InsertNode() {
            var tree = $find("<%= RadTreeView1.ClientID %>");
            tree.trackChanges();
            var node = new Telerik.Web.UI.RadTreeNode();
            node.set_text("New Node");
            tree.get_nodes().insert(0, node);
            tree.commitChanges();
        }        
removeRadTreeNodenoneRemoves a child Node from the Nodes collection of a Node.
CopyJavaScript
        function RemoveNode() {
            var tree = $find("<%= RadTreeView1.ClientID %>");
            var node = tree.findNodeByText("New Node");
            tree.trackChanges();
            node.get_parent().get_nodes().remove(node);
            tree.commitChanges();
        }        
removeAtintnoneRemoves the Node at the specified index.
CopyJavaScript
        function RemoveNode() {
            var tree = $find("<%= RadTreeView1.ClientID %>");
            var node = tree.findNodeByText("New Node");
            tree.trackChanges();
            node.get_parent().get_nodes().removeAt(0);
            tree.commitChanges();
        }        
clearnonenoneRemoves all Nodes from a Node collection.
CopyJavaScript
        function RemoveNode() {
            var tree = $find("<%= RadTreeView1.ClientID %>");
            var node = tree.findNodeByText("New Node");
            tree.trackChanges();
            node.get_parent().get_nodes().clear();
            tree.commitChanges();
        }        
getNodeintRadTreeNodeGets the Node from the Nodes collection residing at the index defined by the parameter passed to the function.
CopyJavaScript
        function GetNode() {
            var tree = $find("<%= RadTreeView1.ClientID %>");
            var node = tree.get_nodes().getNode(0);
            node.set_text("My Text");
        }    
indexOfRadTreeNodeintGets the position of the Node within the Nodes collection.
CopyJavaScript
        function IndexOf() {
            var tree = $find("<%= RadTreeView1.ClientID %>");
            var node = tree.get_nodes().getNode(0);
            var index = tree.get_nodes().indexOf(node);
            node.set_text("index: " + index);
        }        
get_countnoneintGets the count of the Nodes in the Nodes collection of a Node.
CopyJavaScript
        function GetCount() {
            var tree = $find("<%= RadTreeView1.ClientID %>");
            var node = tree.get_nodes().getNode(0);
            var count = node.get_nodes().get_count();
            node.set_text("Count: " + count);
        }