how to deselect telerik treeview node on form body click?

4 posts, 0 answers
  1. Burepalli V S Rao
    Burepalli V S Rao avatar
    23 posts
    Member since:
    Oct 2009

    Posted 31 May 2012 Link to this post

    Hi Friends,

    i want to deselect the telerik treeview node on form body click using javascript?

    how to do that?

    Burepalli V S Rao.
  2. Plamen
    Plamen avatar
    2725 posts

    Posted 04 Jun 2012 Link to this post


    You can use the unselectAllNodes function of the client object of RadTreeView when one clicks outside of it.

    Hope this will help you.

    All the best,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
  4. Mohinder Goswami
    Mohinder Goswami avatar
    24 posts
    Member since:
    Nov 2008

    Posted 07 Jun 2012 Link to this post


    i want this only, but when i call this function like the below one

    window.document.body.onclick = UnSelectAllNodes;
    it is getting deselecting the nodes, but after that if i click on item then it has to select it, but it is not getting selected

    Burepalli V S Rao.
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Jun 2012 Link to this post

    Hello Mohinder,

    I have created a sample code based on your scenario. Please check the following code snippet.
    <form id="form1" runat="server" onclick="deselect();" style="background-color:Red;">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <telerik:RadTreeView ID="RadTreeView1" runat="server" OnClientNodeClicking="OnClientNodeClicking"  >
        <telerik:RadTreeNode Text="Node1"></telerik:RadTreeNode>
        <telerik:RadTreeNode Text="Node2"></telerik:RadTreeNode>
        <telerik:RadTreeNode Text="Node3"></telerik:RadTreeNode>
        <telerik:RadTreeNode Text="Node4"></telerik:RadTreeNode>

    <script type="text/javascript">
        var i;
        function deselect() {
        var tree = $find("<%= RadTreeView1.ClientID%>");
        if (i != 0) {
          i = 1;
        function OnClientNodeClicking(sender, args) {
            i = 0;

Back to Top