How to disable node selected on Parent node ?

2 posts, 0 answers
  1. VnDevil
    VnDevil avatar
    58 posts
    Member since:
    Oct 2012

    Posted 29 May 2010 Link to this post

    Hi,

    Please help me with the following issue:
    I want to disable the selection on parent node in this code below

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DisableNodeSelected.aspx.cs" Inherits="Portal.Demo.RadControls.RadTreeView.DisableNodeSelected" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head runat="server"
        <title></title
    </head> 
    <body> 
        <form id="form1" runat="server"
        <div> 
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
            <telerik:RadTreeView ID="RadTreeView1" runat="server"
                <Nodes> 
                    <telerik:RadTreeNode Text="Parent 1" Value="Parent 1" Selected="true"
                        <Nodes> 
                            <telerik:RadTreeNode Text="Child 01" Value="Child 01" /> 
                            <telerik:RadTreeNode Text="Child 02" Value="Child 02" /> 
                            <telerik:RadTreeNode Text="Child 03" Value="Child 03" /> 
                            <telerik:RadTreeNode Text="Child 04" Value="Child 04" /> 
                            <telerik:RadTreeNode Text="Child 05" Value="Child 05" /> 
                        </Nodes> 
                    </telerik:RadTreeNode> 
                    <telerik:RadTreeNode Text="Parent 2" Value="Parent 2"
                        <Nodes> 
                            <telerik:RadTreeNode Text="Child 01" Value="Child 01" /> 
                            <telerik:RadTreeNode Text="Child 02" Value="Child 02" /> 
                            <telerik:RadTreeNode Text="Child 03" Value="Child 03" /> 
                            <telerik:RadTreeNode Text="Child 04" Value="Child 04" /> 
                            <telerik:RadTreeNode Text="Child 05" Value="Child 05" /> 
                        </Nodes> 
                    </telerik:RadTreeNode> 
                </Nodes> 
            </telerik:RadTreeView> 
        </div> 
        </form> 
    </body> 
    </html> 
     


  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 01 Jun 2010 Link to this post

    Hi DA DA,

    You can achieve this by simple JavaScript function, which is going to trap the ClientNodeClicked event over the TreeView, and then check if the clicked node is root and if it is - remove the selection from it (if this is the only thing that you want to prevent).

    Here is reference for Client-side programming with RadTreeView in our help documentation that should help you with finding and using the methods in the client objects (tree, treeNode, treeNodeCollection): http://www.telerik.com/help/aspnet-ajax/tree_clientprogramming.html

    Hope that this is going to help you!


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top