Determine target of drag and drop operation

3 posts, 0 answers
  1. neebs
    neebs avatar
    106 posts
    Member since:
    Apr 2007

    Posted 22 Dec 2011 Link to this post

    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. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 23 Dec 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. neebs
    neebs avatar
    106 posts
    Member since:
    Apr 2007

    Posted 23 Dec 2011 Link to this post

    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   
Back to Top