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

Cancel drop event

1 Answer 102 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Roman Gomolko
Top achievements
Rank 1
Roman Gomolko asked on 12 Nov 2009, 02:00 PM
Hi.

I got interesting problem using RadTreeView and RadDragAndDropManager.
I want to implement verification of drop operation.
  • user drops one item to another
  • Confirmation
  • Cancel drop operation if needed.

I'm using TreeView bounded to ObservableCollection<T>.
I'm attached to OnCollectionChanged event in the collection and to OnDragEnded in TreeView

As I can see in my test application OnCollectionChanged event fires before OnDragEnded. It's seems that here (RadDragAndDropManager or RadTreeView) should be another event fired before changing data.

Could you help me with it?

Best regards, Roman

1 Answer, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 18 Nov 2009, 03:51 PM
Hi Roman Gomolko,

There are two ways to handle delayed drag-drop. They both involve cancelling the default DragDrop action and carrying it out if the user confirms the drag-drop. Cancelling the default drag-drop action for the TreeView is done by handling the PreviewDragEnded event.

I modified one of our online example to show this. In one of the projects a ContextMenu is shown, while the other displays a  Confirm dialog (what I gather you need).

Hopefully you will find the two projects useful.

All the best,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TreeView
Asked by
Roman Gomolko
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Share this question
or