Error when deleting exception appointment in a recurrent series

3 posts, 0 answers
  1. Umit
    Umit avatar
    2 posts
    Member since:
    Nov 2012

    Posted 22 Nov 2012 Link to this post

    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. Plamen
    Admin
    Plamen avatar
    2958 posts

    Posted 23 Nov 2012 Link to this post

    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.
  3. Umit
    Umit avatar
    2 posts
    Member since:
    Nov 2012

    Posted 23 Nov 2012 Link to this post

    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
Back to Top