This is a migrated thread and some comments may be shown as answers.

Problems with editing one occurrence of a recurring appointment

3 Answers 353 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jill-Connie Lorentsen
Top achievements
Rank 1
Jill-Connie Lorentsen asked on 29 Apr 2013, 11:27 AM
I have some problems dealing with recurring events.

If I add a series, I can edit or delete the entire series. The problem is if I want to edit or delete only one occurrence.

If I try to delete only one occurrence nothing happens. The RadScheduler_AppointmentDelete event is not hit, the wait cursor spins for a couple of seconds and the event is still there.

If I edit only one occurrence a new appointment is stored in the database, with RecurrenceParentID set to the id of the parent appointment, and the series is still there. From what I have read this is standard behaviour.

But then if I want to edit this event, first I get the question whether I want to edit this occurrence or the entire series. If I manually set  RecurrenceParentID=null in the database this question dissappears, but this invokes other problems.

Why is the first occurrence of the series  e.Appointment.RecurrenceState == RecurrenceState.Exception after changing one of the other occurences?

How am I supposed to handle the RecurrenceExceptionCreated event?

Regards, Jill-Connie Lorentsen


3 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 01 May 2013, 12:27 PM
Hello,

When you delete a single appointment from a recurring series, you are actually modifying the Master appointment, telling it that it should skip the date in the recurring series. That's why instead of the AppointmentDelete event, the AppointmentUpdate event is fired for the master appointment. This happens because by nature the recurring series is treated as one appointment, rather that a collection of appointments.

When you edit a single occurrence, you are creating an exception in the Master appointment. The result is a new appointment, which behaves as a separate one (that's why it's stored separately in the database). However, there is still a link between the exception and the master, and you can still modify the master from the exception. That's why the dialog appears. For instance, you can choose to select an exception, edit the series and click Reset Exceptions, to return the state to the initial one.

As for the question - "How am I supposed to handle the RecurrenceExceptionCreated event", it really depends on what you want to accomplish.

Hope this clarifies things a bit. If you have any specific questions or issues, we'll be happy to assist.
 

Greetings,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jill-Connie Lorentsen
Top achievements
Rank 1
answered on 01 May 2013, 02:08 PM
Thank you for you reply, it is clearifying!

 What I want is standard behavior, I want to edit and delete the entire series (which works fine), and just one occurrence, which is where the problem is. Do I have to handle the RecurrenceExceptionCreated or any other event in order to achieve standard behavior? Maybe you have a sample I can look at?

I can edit one occurrence, but if I try to delete the entire series afterwards this occurence is not deleted. If I try to delete the "exception" occurrence no events are hit, and nothing happens.

Also, if I have a series, edit one occurrence, and then go to the master appointment and try to delete (both this only or the entire series) nothing happens. If I go to one of the occurrence that are not master, I can delete this occurrence only, but if I try to delete the series all occurrences except the "exception". The RadScheduler_AppointmentDelete is hit once.

I am binding to a generic list, like in your example http://demos.telerik.com/aspnet-ajax/scheduler/examples/bindtolist/defaultcs.aspx

Thank you very much for your help!


Regards, Jill-Connie Lorentsen
0
Bozhidar
Telerik team
answered on 06 May 2013, 08:39 AM
Hi,

When you delete an Occurrence, the OnOccurrenceDelete event of RadScheduler is fired.

When you delete an exception, the OnAppointmentDelete event is fired, since the exception appointment is treated like a regular appointment.

To delete the entire series, you have to choose the "Edit the series" option from the dialog that appears when you click the delete icon of the appointment. Then the OnAppointmentDelete event is fired once for each exception, and once for the master appointment.
 

Kind regards,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Jill-Connie Lorentsen
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Jill-Connie Lorentsen
Top achievements
Rank 1
Share this question
or