Hi, I am trying to handle the appointment deletion event, but it doesn't seem to fire when the appointment that's being removed is an occurrence of a recurrence. Does anyone have any ideas about how I can detect this and fire code when it happens?
Hello,
I would recommend that you utilize the AfterRecurringAppointmentDeleted event on the UltraCalendarInfo object for this.
Please let me know if you have any other questions or concerns on this matter.
Hmm. Ok I did a bit of testing, and you're 100% right, that is exactly the event I need. Unfortunately I am having some problems with it. In my project I created a custom appointment dialog box, and when deleting an occurrence from it, the event doesn't fire. It only fires if I click the event from my monthviewsingle and press the delete key. I was under the impression that in order to remove an occurrence, all I had to do was set the isRemoved property to true. This does prevent it from showing on the calendar, but it does not fire the event. Do you know if there is something else that I need to do in order to get the event to fire?
I have been looking into the source code for the behaviors that will fire the AfterRecurringAppointmentDeleted event, and it appears that this will fire mainly for changes that you make to the appointment through the UI. I don’t believe it will fire simply by setting the IsRemoved property on the Appointment object.
If you have a custom appointment dialog box though, and you are the one setting the IsRemoved property to true, is there a reason you need the event to fire? It seems likely that you could execute the code that you would be doing in the event handler at the point that you set this, since you effectively know when you are deleting the corresponding appointment?
Although that would work, it isn't exactly ideal. Let me give you a little more context. So the reason I need to handle the event at all is because I am trying to sync my calendar with my outlook calendar. So when an appointment is deleted from my calendar, I need to send a delete request to microsoft so their calendar reflects the changes in mine. All of the code for handling communication with microsoft is contained within a separate class, and is only interacted with by handling events from the CalendarInfo object. I would prefer to not make my custom dialog box dependent on this class, so simply placing the code like you mentioned would be a bit problematic. I think the solution I am going to go with is to add an event to my custom dialog box, and raise it at the point you mentioned. Then I can handle it like I handle the CalendarInfo events, and keep my custom appointment dialog box functionally separate. Thanks for all your help. I really appreciate it. :)