I created a UserControl based on a ScheduleView. My UserControl offer an OnCanDrop event so I implemented a DragDropCustomBehavior to reach my goal. In the CanDrop override method of my DragDropBehavior, I don't want to raise my event when I'm over the appointment I'm dragging...
I have a UserControl which contain a ScheduleView, my UserControl provide a "OnCanDrag" event and I want my event to be fire only once when I enter in a new slot, I don't want my event to be fire as many time as I move in the new slot.
answered on 14 Apr 2014, 02:35 PM
You could achieve the desired if you set the SnapAppointments property of the ScheduleView to true and keep the current destination Slot in the custom DragDropBehavior. This way will be able to do custom logic only when the destination slot has changed. Please check the following code snippet:
private Slot slot = new Slot();
public override bool CanDrop(DragDropState state)
var destinationSlot = state.DestinationSlots.First();
this.slot = destinationSlot;
However if this doesn't help, I'll ask you to share some more details on the exact scenario and requirements.
I'm looking forward to hearing from you.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.