Disable only the root Node or Root Node should be non clickable

3 posts, 0 answers
  1. Goutham
    Goutham avatar
    9 posts
    Member since:
    Sep 2010

    Posted 08 Mar 2011 Link to this post

    Hi There,

    I have treeview with 2 and 3 level sub node. On click of each node i am loading the iframe on right side. i want disable the clicking of root nodes because on click of root nodes nothing should happen.Is it possible to disable the root node clicking or just disable the root nodes
    and also the treeview is fullExpanded state.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Mar 2011 Link to this post

    Hello Goutham,

    You can cancel the event when clicking on the root node like below.

    ASPX:
    <telerik:RadTreeView runat="server" ID="RadTreeView1" OnClientNodeClicking="ClientNodeClicking">
        <Nodes>
            <telerik:RadTreeNode runat="server" Text="Australia" Value="RootItems">
                <Nodes>
                    <telerik:RadTreeNode runat="server" Text="Sidney">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode runat="server" Text="Brisbane">
                    </telerik:RadTreeNode>
                </Nodes>
            </telerik:RadTreeNode>
           </Nodes>
    </telerik:RadTreeView>

    Java Script:
    <script type="text/javascript">
        function ClientNodeClicking(sender, args) {
           if (args.get_node().get_text() == "Australia") {
               args.set_cancel(true);
            }
       }
    </script>

    Thanks,
    Princy.
  3. Goutham
    Goutham avatar
    9 posts
    Member since:
    Sep 2010

    Posted 09 Mar 2011 Link to this post

    Hey Princy,

    Thanks for the reply. I am using radtreeview 6.3.8.0 assembly in this OnClientNodeClicking is not there
    AfterClientClick or BeforeClientClick is available.
Back to Top