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

Problem of PreviewDragEnded Event on RadTreeView

2 Answers 67 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
alino
Top achievements
Rank 1
alino asked on 07 Oct 2010, 02:53 PM
Hi,

I have a problem when I drag and drop my TreeViewItems in the TreeView. I use PreviewDragStarted and PreviewDragEnded event to manage my dropping. The PreviewDragStarted Work perfectely. But the problem is with PreviewDragEnded. The Event arises only  when I drop in any place in the the TreeView exept the same place.
When i cancel the dragging or when I drop out of the TreeViw (for example in the other place of the main window) PreviewDragEnded doesn't arises. (For information IsDragPreviewEnabled, IsDragToolTipEnabled and IsLineEnabled are all set to true).

Thank u for helping me to solve the problem.

Alino

2 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 13 Oct 2010, 08:33 AM
Hi alino,

Sorry for the delayed reply. Dropping an item onto itself  or onto its father RadTreeViewItem or onto its children RadTreeViewitems (direct or not) is an invalid drop operation which does not fire  the RadTreeView.PreviewDragEnded event.  Therefore you cannot use the default RadTreeView drag and drop logic. You can use a DragAndDropManager and its events to implement adding a copy of the dragged RadTreeViewItem to the specific locations mentioned above. For the other drop locations you can handle the PreviewDragEnded event. Please find the attached solution which demonstrates such functionality and tell me if it satisfies your needs.


I hope this is helpful for you. Feel free to ask if you need further assistance.

Regards,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
alino
Top achievements
Rank 1
answered on 20 Oct 2010, 08:48 PM
Hi Mladenov,

Thank U very much for your advice. I have adapted your idea to my application and now i can easily catch the drag cancel and call my logic for that case.
Best regards,

Alino

Tags
TreeView
Asked by
alino
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
alino
Top achievements
Rank 1
Share this question
or