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

Error when deleting exception appointment in a recurrent series

2 Answers 72 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Umit
Top achievements
Rank 1
Umit asked on 22 Nov 2012, 04:51 PM
Hi,
When I attempt to delete the exception appointment of a recurrent series, I get the following exception:

System.InvalidOperationException: Cannot locate the parent of appointment with ID = '135'. Ensure that the parent appointment with ID = '36' exists and is loaded.
   at Telerik.Web.UI.Scheduling.AppointmentController.DeleteAppointment(Appointment appointmentToDelete, Boolean deleteSeries)
   at Telerik.Web.UI.RadScheduler.DeleteAppointment(Appointment appointmentToDelete)
   at Telerik.Web.UI.RadScheduler.ProcessPostBackCommand(SchedulerPostBackEvent postBack)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at Telerik.Web.UI.Scheduling.AppointmentController.DeleteAppointment(Appointment appointmentToDelete, Boolean deleteSeries)
   at Telerik.Web.UI.RadScheduler.DeleteAppointment(Appointment appointmentToDelete)
   at Telerik.Web.UI.RadScheduler.ProcessPostBackCommand(SchedulerPostBackEvent postBack)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I'm binding the scheduler to the list of objects I get from the DB in page load event. Deleting series or a single appointment works fine. Resizing, moving, editing appointments (including exception appointments) also work fine.

Could you point me to the correct direction to resolve this issue?

Cheers

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 23 Nov 2012, 07:15 AM
Hi Umit,

 
Such error could be observed if the parent appointment somehow is not loaded from the datasource because of some filtering of the appointments. Would you please review our Bind To List Demo where is implemented a scenario similar to what you have described and let us know if this error can be reproduced there as well? If not I will recommend you to compare to with your case and do the necessary changes.

Hope this will be helpful.

Kind regards,
Plamen
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
Umit
Top achievements
Rank 1
answered on 23 Nov 2012, 08:29 AM
Hi Plamen,

Thanks for your answer. I've found the problem. The ID field is of string type in my list and the RecurrenceParentID is Nullable<int>. I added the following into DataBound event:
 
if(e.Appointment.RecurrenceParentID != null)
    e.Appointment.RecurrenceParentID = e.Appointment.RecurrenceParentID.ToString(); 

That fixed the issue.

Thank you,
Umit
Tags
Scheduler
Asked by
Umit
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Umit
Top achievements
Rank 1
Share this question
or