Select Only One Child Node

5 posts, 0 answers
  1. Kishor Dalwadi
    Kishor Dalwadi avatar
    40 posts
    Member since:
    Nov 2009

    Posted 11 Aug 2010 Link to this post

    Hello Sir,

    I am Using RadTree.

    My requirement is like I want only select one child node in tree in backend side.

    Please Give me proper solution.

    Thanks.

    Kishor Dalwadi
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Aug 2010 Link to this post

    Hi,


    I am not quite sure about the requirement. But if you want to select a single node at a time, then set the "MultipleSelect" property of RadTreeview to false.


    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kishor Dalwadi
    Kishor Dalwadi avatar
    40 posts
    Member since:
    Nov 2009

    Posted 11 Aug 2010 Link to this post

    Hello Shinu

    Thanks for Reply.

    Actually I Want Node Selection Like RadioButton and Parent Node is not selectable by User.

    So Child Nodes are Only Selectable in tree.

    Thanks

    Kishor Dalwadi.
  5. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 12 Aug 2010 Link to this post

    Hello Kishor Dalwadi,

    By default you can select only one node at a time in the RadTreeView.
     
    Could you please explain more on: "Parent Node is not selectable by User"?

    If you want to be able to select only leaf nodes (nodes that don't have children) you'll need to subcribe to the OnClientNodeClicking event and use the following code in the handler:

    function clientNodeClicking(sender, args) {
                var tree = $find("<%= RadTreeView1.ClientID %>");
                for (var i = 0; i < tree.get_allNodes().length; i++) {
                    if (args.get_node().get_nodes().get_count() == 0) {
                        args.set_cancel(true);
                    }
                }
            }

    Greetings,
    Veronica Milcheva
    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
  6. Ron
    Ron avatar
    48 posts
    Member since:
    Oct 2010

    Posted 26 Jan 2011 Link to this post

    Shouldn't this simply be:

    function clientNodeClicking(sender, args) {
          if (args.get_node().get_nodes().get_count() > 0) {
               args.set_cancel(true);
          }
    }
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017