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

Modify Delete Appointment Event

Hi,

How can I override or catch the event when deleting appointments in schedule control.

What I did is right-click the appointment and click the "Delete Item" in context menu. 

Thanks.

3 Replies

AR Arulpriya Ramalingam Syncfusion Team November 29, 2019 08:34 AM UTC

Hi Eric, 
 
Thank you for using support. 
 
We already provided a knowledge base document to subscribe the DeleteItemClick event of ScheduleControl. Please make use of below online document to implement it. 
 
 
Please get back to us, if you have any other queries. 
 
Regards, 
Arulpriya 



ER Eric December 1, 2019 05:43 PM UTC

Hi,

I used to code provided in the link. But when I used it, I encounter an error saying "System.NullReferenceException: 'Object reference not set to an instance of an object.'".

This is the code that has an error:

//Get the menu items.
strip = this.scheduleControl1.GetScheduleHost().ContextMenuStrip;

Also, in the output logs, it says "**strip** was null."

Thanks


AR Arulpriya Ramalingam Syncfusion Team December 2, 2019 05:41 AM UTC

Hi Eric, 
 
Thank you for the update. 
 
As per the ScheduleControl current behavior, the ContextMenuStrip will be initialized when the datasource for the ScheduleGrid is assigned. So, ensure that you are retrieving the ContextMenuStrip after the schedule is bounded with dataprovider. If still the issue exist at your end, we suspect that it might be occurred due to some other customization of ScheduleGrid. Please refer to the below sample and let us know the code part that causes the issue at your end which will be better for us to analyze further on this scenario. 
 
 
If you have any other queries, please get back to us. 
 
Regards, 
Arulpriya 


Loader.
Live Chat Icon For mobile
Up arrow icon