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

Cancelled Drop On RadScheduleView Still Removes Item From ListBox

5 Answers 76 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Veteran
Anthony asked on 01 Nov 2013, 03:25 AM
Hi,

I am dragging items between a ListBox and a RadScheduleView.

On a successful drag and drop the item is removed from the ListBox and added to the RadScheduleView.

If I decide to cancel the Drop in my custom ScheduleViewDragDropBehavior overidden Drop method  the RadScheduleView behaves correctly and does not add the item. However the ListBox still removes the item.

How can I stop the ListBox from removing the item when the Drop is cancelled by the RadScheduleView?

Thanks
Anthony

5 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 05 Nov 2013, 01:16 PM
Hello Anthony,

The information you provided is not enough for a general solution, however I can suggest that the poroblem is that you are removing the item from the listbox, without checking the DragEffects first, you can try to modify your logic to check if the effects are equal to something that requires the item to be deleted and remove the item only then.

Hope this helps! 

Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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 >>
0
Anthony
Top achievements
Rank 1
Veteran
answered on 05 Nov 2013, 09:38 PM
Hi,

To clarify, my code is never removing the item from the ListBox, the Telerik drag and drop infrastructure is doing the removal automatically.

It should not remove the item from the ListBox if the drop is cancelled on the RadScheduleView.

Thanks
Anthony
0
Nick
Telerik team
answered on 06 Nov 2013, 12:32 PM
Hello Anthony,

In that case, you can inherit from the default behaviors and override the actions on Drop, DragDropCompleted etc. 

Hope this helps! 


Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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 >>
0
Anthony
Top achievements
Rank 1
Veteran
answered on 06 Nov 2013, 09:32 PM
Hi,

I can override DragDropCompleted in the ListBoxDragDropBehavior for the source control but there is nothing in the DragDropState that indicates that the drop was cancelled by the destination control.

I would need to keep track of this manually which is a bit ugly.

It seems that the DragDropState should pass additional information so a user can correctly determine state.

Thanks
Anthony
0
Nick
Telerik team
answered on 08 Nov 2013, 08:38 AM
Hello Anthony,

You are absolutely right. We will try to include this in one of our next releases, in the mean time you will have to handle this manually. 

We are sorry for any inconvenience caused! 

Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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
DragAndDrop
Asked by
Anthony
Top achievements
Rank 1
Veteran
Answers by
Nick
Telerik team
Anthony
Top achievements
Rank 1
Veteran
Share this question
or