Having problems dragging RadTreeNode into RadDockZone populated with RadDocks

2 posts, 1 answers
  1. Tyler
    Tyler avatar
    6 posts
    Member since:
    Oct 2009

    Posted 10 Nov 2009 Link to this post

    I'm dynamically creating RadDock's within a RadZone (vertically).  In order to add another RadDock in the RadZone, I am dragging a RadTreeNode into the RadDockZone.  The problem I am running into is that if I drop a RadTreeNode on a RadDock that has been dynamically created in the RadDockZone the OnNodeDrop event is not fired. 

    I've have verified that OnClientNodeDropping is still called regardless.  The only difference is that the server side event is not fired when dropped on the RadDock, which is in the RadDockZone....but the server side event is fired when dropped directly on the RadDockZone.

    Has anyone run into this issue before?
  2. Answer
    Dimitar Milushev
    Dimitar Milushev avatar
    555 posts

    Posted 16 Nov 2009 Link to this post

    Hi Tyler,

    If you drop the TreeNode on an element that has no ID, the TreeView does not postback automatically. This is because there is no way to communicate to the server where was the node dropped and to prevent postbacks if the user accidentally drops the node on some unrelated element.

    For your scenario to work, you need to use the OnClientNodeDropping event and set the htmlElement manually to an element that has an ID. This is very similar to the approach used in the Drag and Drop demo of the TreeView and more specifically the droppedOnGrid function that determines if the target element is part of the Grid and then sets the Grid as the 'target' element using args.set_htmlElement:

                    function droppedOnGrid(args)
                     var target = args.get_htmlElement();
                     if(target.id == gridId)
                     target = target.parentNode;

    I hope this helps.

    Regards, Dimitar Milushev
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top