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

Detect drag/drop cancel

1 Answer 88 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Håkan
Top achievements
Rank 1
Håkan asked on 30 Jan 2014, 10:32 AM
Hi!

I'm using the following code to manage drag and drop from a listbox to the ScheduleView:

RadDragAndDropManager.AddDragQueryHandler(MyList, new EventHandler<DragDropQueryEventArgs>(this.OnDragQuery));
RadDragAndDropManager.AddDropQueryHandler(MyList, new EventHandler<DragDropQueryEventArgs>(this.OnDropQuery));

In the OnDragQuery() method I change the snapping behavior of the ScheduleView because I want different behavior when dragging appointments within the ScheduleView and when dragging items from the ListBox into the ScheduleView.
In the OnDropQuery() method I reset the behavior back to default again.

The problem occurs if the user cancels the drag by for example pressing the Escape-key.
I don't know how to catch that event so that I can reset the behavior there also.

I have noticed that the DragStatus enum used in DragDropQueryEventArgs contains several statuses that I would like to handle.
But I don't understand how to reach them. The OnDragQuery() method only fires upon drag and the RadDragAndDropManager does not have a suitable method like for example AddDragCancelHandler.

Regards,
Håkan




1 Answer, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 03 Feb 2014, 12:18 PM
Hi Håkan,

First, I would like to note that RadDragAndDropManager is obsolete and should be replaced with DragDropManager. As to the drag and drop between RadScheduleView and RadListBox - I'd suggest that you check the following example in our XAML SDK Repository:
https://github.com/telerik/xaml-sdk/tree/master/ListBox/DragDropWithScheduleView
which demonstrates how the drag-drop can be implemented using the built-in ListBoxDragDropBehavior and customizing the ScheduleViewDragDropBehavior.
The additional functionality that you're describing should be added inside the ScheduleViewDragDropBehavior methods, please check here for more details.

Please try it and if you have any issues/questions, write to us again.

Regards,
Yana
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ScheduleView
Asked by
Håkan
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or