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

Destination always TreeView instead of TreeViewItem on Drag and Drop

4 Answers 52 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
jason
Top achievements
Rank 1
jason asked on 18 May 2012, 03:58 PM
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.

4 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 21 May 2012, 01:36 PM
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 >>

0
jason
Top achievements
Rank 1
answered on 22 May 2012, 03:02 PM
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.
0
Accepted
Tina Stancheva
Telerik team
answered on 22 May 2012, 03:07 PM
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 >>

0
jason
Top achievements
Rank 1
answered on 23 May 2012, 05:43 PM
Answer was given in support ticket.  Changed AllowDrop to IsDragDropEnabled for tree view and that fixed it. 
Thanks.
Tags
TreeView
Asked by
jason
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
jason
Top achievements
Rank 1
Share this question
or