Child restriction in treeview

4 posts, 0 answers
  1. Alan
    Alan avatar
    10 posts
    Member since:
    May 2012

    Posted 12 Jul 2012 Link to this post

    I was enabling a drag and drop in treeview but I want restrict nodes from having more than 2 children.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Jul 2012 Link to this post

    Hi Alan,

    Try the following code to achieve your scenario.

    <telerik:RadTreeView ID="RadTreeView1" runat="server" EnableDragAndDrop="true" EnableDragAndDropBetweenNodes="true" onnodedrop="RadTreeView1_NodeDrop" >

    protected void RadTreeView2_NodeDrop(object sender, Telerik.Web.UI.RadTreeNodeDragDropEventArgs e)
     RadTreeNode destNode = e.DestDragNode;
     if (destNode.Nodes.Count < 2)

    Hope this helps.

  3. DevCraft R3 2016 release webinar banner
  4. Ivana
    Ivana avatar
    657 posts

    Posted 16 Jul 2012 Link to this post

    Hi Alan,

    The following online demos shows a very good example of nodes' drag and drop functionality of RadTreeView on the client as well as on the server:

    I hope it will help.

    Kind regards,
    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.
  5. Rakesh
    Rakesh avatar
    2 posts
    Member since:
    May 2013

    Posted 04 Jun 2013 Link to this post

    Hello Princy

    It is possible to show cursor image as a validation on drag drop functionality ??
Back to Top