Destination always TreeView instead of TreeViewItem on Drag and Drop

5 posts, 1 answers
  1. jason
    jason avatar
    28 posts
    Member since:
    Oct 2010

    Posted 18 May 2012 Link to this post

    I have a tree view control inside a templated control.  Next to this I have a data grid that allows dragging items from the grid to the tree.  This had always worked but sometime in the last few months it stopped.  Now when I drag over the tree the DropQueryEvent fires ok but the destination is always RadTreeView instead of RadTreeViewItem even when I am right over an item in the tree.  As I said this used to work but no idea when it stopped so not sure if it was after we upgraded the assembly version or not.  Here is my event:

    _folderList.AddHandler(RadDragAndDropManager.DropQueryEvent, new EventHandler<DragDropQueryEventArgs>(TreeDropQuery), true);


    And here is the method:

    if (e.Options.Destination == null)
                   return;
     
               if (!(e.Options.Destination is RadTreeViewItem)) return;
               if (!(((RadTreeViewItem)e.Options.Destination).Item is WorkspaceNode) &&
                  !(((RadTreeViewItem)e.Options.Destination).Item is FolderNode))
                   return;
     
               e.QueryResult = true;
               e.Handled = true;

    The code always returns at if (!(e.Options.Destination is RadTreeViewItem)) return;
    because it is always RadTreeView.
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 21 May 2012 Link to this post

    Hello Jason,

    Can you please elaborate on the scenario in which the issue can be reproduced? I tested it in a sample where a drag/drop operation between the RadGridView and the RadTreeView is implemented, but I wasn't able to reproduce it. I attached this sample and you can test it on your side. If you can reproduce the issue in it, please send us the list of steps that we need to follow. And if it doesn't demonstrate your scenario correctly, please modify it accordingly so that we can further investigate the case.

    Thank you in advance.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. jason
    jason avatar
    28 posts
    Member since:
    Oct 2010

    Posted 22 May 2012 Link to this post

    I have updated the solution to resemble my scenario and it also reproduces my problem.  It does not appear that I am able to actually attach this zip file though because .zip is not allowed.  Do I need to open support ticket?  Can it be linked to this post?

    Thanks.
  5. Answer
    Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 22 May 2012 Link to this post

    Hi Jason,

    Yes, it's best to open a support ticket and attach your solution there. And even though the support ticket and the forum thread can't be linked, we can update this forum as soon as we found the cause for the issue. This way the community can also follow the case.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. jason
    jason avatar
    28 posts
    Member since:
    Oct 2010

    Posted 23 May 2012 Link to this post

    Answer was given in support ticket.  Changed AllowDrop to IsDragDropEnabled for tree view and that fixed it. 
    Thanks.
Back to Top
DevCraft banner