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

Determine target of drag and drop operation

2 Answers 77 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
neebs
Top achievements
Rank 2
neebs asked on 23 Dec 2011, 02:58 AM
I'm implementing an interface similar to the one shown here:

http://demos.telerik.com/aspnet-ajax/treelist/examples/itemsdragdrop/defaultcs.aspx 

and I am able to fire an event that has all the information about the dragged item that I need in my code behind. However I'm struggling trying to find out what item the item was dropped on. I need to accomplish this because I need to know whether to a) add the new item as a child of the parent when dropped on an outer node, or b) add the new item as a sibling after the drop target when dropped on an inner node. I also need the identity (some clientDataKeyItem?) for the drop target so that I act on it in the code behind. Any help on this would be appreciated.

Steve

2 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 23 Dec 2011, 09:51 AM
Hi Steve,

If you are dropping on an item in the same RadTreeList, the server-side ItemDrop event provides all the information you need related to the target item or HTML element. If dropping on a different RadTreeList instance, however, only the e.HtmlElement property is set containing the id of the HTML element that is the target of the dropped items.

Veli
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
0
neebs
Top achievements
Rank 2
answered on 23 Dec 2011, 06:58 PM
I was able to locate that (e.HtmlElement ) but unfortunately I need to access the data keys to identify the target. For now I am switching to TreeView instead of TreeList. 

Steve   
Tags
TreeList
Asked by
neebs
Top achievements
Rank 2
Answers by
Veli
Telerik team
neebs
Top achievements
Rank 2
Share this question
or