Select child nodes of parent on click without selecting the parent node

2 posts, 0 answers
  1. Brian
    Brian avatar
    13 posts
    Member since:
    May 2013

    Posted 11 Jul 2013 Link to this post

    Because the dropdowntree API is so sparse (I do not really understand why it does not have the same API as the treeview for that part of the control), I am looking at using the treeview in a combobox.  Assuming the following tree structure:

    Two levels only

    Level 0a
    Level 1a
    Level 1b
    Level 0b
    Level 1c

    I need to be able to click on a Level 0 item and select its child noes, but not the Level 0 node itself.  In other words, after clicking on Level 0a in the above structure, I need to to look like this:

    Level 0a - unchecked
    Level 1a - checked
    Level 1b - checked
    Level 0b -unchecked
    Level 1c -unchecked 
    Level1d - unchecked 

    Is there an easy way to do this?  Also, it would be great if I could uncheck the nodes in the other branches as well.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Jul 2013 Link to this post

    Hi Brian,

    Please have a look at the following code I tried which works fine at my end. When the user select a node by clicking it, that particular RadTreeNode gets expanded with all its child nodes checked.

    <telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="true" OnClientNodeClicked="OnClientNodeClicked">
            <telerik:RadTreeNode Value="PersonalFolders" Checkable="false" ImageUrl="../Images/Fol1.JPG"
                AllowEdit="false" Text="Personal Folders">
                    <telerik:RadTreeNode Value="PublicFolders1" ImageUrl="../Images/SD.png" AllowEdit="false"
                        Text="Public folders1" Font-Bold="true">
                    <telerik:RadTreeNode Value="PublicFolders2" ImageUrl="../Images/SD.png" AllowEdit="false"
                        Text="Public folders2" Font-Bold="true">
            <telerik:RadTreeNode Value="PrivateFolders" Checkable="false" ImageUrl="../Images/Lock2.JPG"
                AllowEdit="false" Text="Private Folders">
                    <telerik:RadTreeNode Value="PrivateFolders1" ImageUrl="../Images/SD.png" AllowEdit="false"
                        Text="Private Folders1" Font-Bold="true">
                    <telerik:RadTreeNode Value="PrivateFolders2" ImageUrl="../Images/SD.png" AllowEdit="false"
                        Text="Private Folders2" Font-Bold="true">

    <script type="text/javascript">
        function OnClientNodeClicked(sender, args) {
            var childelements = args.get_node().get_allNodes();
            for (var counter = 0; counter < childelements.length; counter++) {

    If you don't want the parent node to remain as selected, you can try the this code. args.get_node().set_selected(false);

  3. DevCraft R3 2016 release webinar banner
Back to Top