Example : We have one customer booking one more room.
2 Answers, 1 is accepted
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 >>