ASPxClientTreeView.GetNode(index) Method

Returns a node specified by its index within the ASPxTreeView's node collection.


    index: number
): ASPxClientTreeViewNode


Name Type Description
index number

An integer value specifying the zero-based index of the node to be retrieved.


Type Description

An ASPxClientTreeViewNode object, representing the node located at the specified index within the ASPxTreeView's node collection.


The ASPxTreeView's client-side functionality enables you to access and manipulate nodes on the client. Use the GetNode method to get the client-side node object at the specified index within the ASPxTreeView's node collection using array notation. This method can be used together with the ASPxClientTreeView.GetNodeCount method when iterating through the list of a node collection.

Note that the index parameter is zero-based and its upper available value is specified by the ASPxClientTreeView.GetNodeCount value, decremented by one. If you pass an invalid index via the parameter, the method returns null.

In order to access nodes further down the ASPxTreeView, you can use the ASPxClientTreeViewNode.GetNode property of a child node.


The code below lists checked nodes and shows them in a label on the client side.

View Example

<script type="text/javascript">
    function OnCheckedChanged(s, e) {
        label.SetText("Checked nodes:");

    function ListCheckedNodes(parent){    
        for (var i=0; i < parent.GetNodeCount(); i++){
            if (parent.GetNode(i).GetChecked()){
               label.SetText(label.GetText() + " " + parent.GetNode(i).GetText());    
            if (parent.GetNode(i).GetNodeCount() != 0){
<dx:ASPxTreeView ID="ASPxTreeView1" runat="server" AllowCheckNodes="True" ClientInstanceName="treeview" DataSourceID="XmlDataSource1">
    <ClientSideEvents CheckedChanged="OnCheckedChanged" />
<br />
<dx:ASPxLabel ID="ASPxLabel1" runat="server" ClientInstanceName="label" Text="Checked nodes:">
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/App_Data/MenuTabbedMenu.xml" XPath="/mainmenu/item"></asp:XmlDataSource>
See Also