This is a migrated thread and some comments may be shown as answers.

Having problems dragging RadTreeNode into RadDockZone populated with RadDocks

1 Answer 79 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Tyler
Top achievements
Rank 1
Tyler asked on 11 Nov 2009, 05:09 AM
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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar Milushev
Telerik team
answered on 16 Nov 2009, 01:29 PM
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();
                
                 while(target)
                 {
                 if(target.id == gridId)
                 {
                 args.set_htmlElement(target);
                 return;                                                  
                 }
                
                 target = target.parentNode;
                 }
                 args.set_cancel(true);
                }


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.
Tags
Dock
Asked by
Tyler
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Share this question
or