We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Control DragAndDrop from Code behind

Hello, is there any way that I can cancel the drag and drop functionality of an appointment after I executed "ScheduleCommands.DragAndDropCommand.Execute()".
I need to be able to cancel it in code behind not clicking outside the item because I modify the clicked appointment and since the drag and drop is active the item persist on view until I click outside the item, and this tend to confuse the user into believing the appointment haven't change. Thank you

1 Reply

KA Karthikraja Arumugam Syncfusion Team February 11, 2020 01:35 PM UTC

Hi Hector, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your requirement of “Unfocus appointment after drag and drop” in UWP. As per Schedule implementation after drop, the appointment remains in draggable state to change the drag position if it is not dropped in the required position. To remove the draggable state, we need to remove focus by tapping any other cell outside the appointment, so which is the behavior of the drag and drop functionality. 
 
If you want to cancel the whole drag and drop function you can achieve it in AppointmentEndDragging event, in which you can set e.Cancel to cancel out the drag and drop action. 
Please refer the following code example for the same, 
schedule.AppointmentEndDragging += Schedule_AppointmentEndDragging; 
 
private void Schedule_AppointmentEndDragging(object sender, AppointmentEndDraggingEventArgs e) 
         e.Cancel = true
 
Please let us know if you have any concern. 
 
Regards, 
Karthik Raja A 


Loader.
Live Chat Icon For mobile
Up arrow icon