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

Leave Can we leave original item stay on after DrapandDrop?

2 Answers 111 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Wenjie
Top achievements
Rank 1
Wenjie asked on 02 Jul 2013, 05:43 PM

Example : We have one customer  booking one more room.

2 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 05 Jul 2013, 08:48 AM
Hi Wenjie,

You just need to customize the ListBox DragDropBehavior and override its DragDropCompleted method with an empty definition. In order to achieve this, you should create a custom class which inherits from Telerik.Windows.DragDrop.Behaviors.ListBoxDragDropBehavior:

public class CustomListBoxDragDropBehavior : Telerik.Windows.DragDrop.Behaviors.ListBoxDragDropBehavior
{
    public override void DragDropCompleted(Telerik.Windows.DragDrop.Behaviors.DragDropState state)
    {
        //base.DragDropCompleted(state);
    }
}

Removing the call to base.DragDropCompleted is actually the way to avoid deleting the item from the Source collection. 

Then you just need to set the newly created class to the DragDropBehavior of the ListBox:

<telerik:RadListBox Grid.Row="1" ..>
 ...
    <telerik:RadListBox.DragDropBehavior>      
        <local:CustomListBoxDragDropBehavior />
    </telerik:RadListBox.DragDropBehavior>
</telerik:RadListBox>

I hope this is helpful.

Regards,
Yana
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
Wenjie
Top achievements
Rank 1
answered on 12 Jul 2013, 03:11 PM
Thanks
Tags
ScheduleView
Asked by
Wenjie
Top achievements
Rank 1
Answers by
Yana
Telerik team
Wenjie
Top achievements
Rank 1
Share this question
or