This is a migrated thread and some comments may be shown as answers.

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

2 Answers 102 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Goutham
Top achievements
Rank 1
Goutham asked on 08 Mar 2011, 08:52 AM
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 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 Mar 2011, 12:46 PM
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.
0
Goutham
Top achievements
Rank 1
answered on 09 Mar 2011, 10:24 AM
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.
Tags
TreeView
Asked by
Goutham
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Goutham
Top achievements
Rank 1
Share this question
or