RecurenceParent is not visible, children are

2 posts, 0 answers
  1. Kevin Kembel
    Kevin Kembel avatar
    48 posts
    Member since:
    Mar 2009

    Posted 26 Sep 2011 Link to this post

    In my implementation, I have some parent appointments that are visible=false.  This is because the parent may belong to another user (not visible), and the single occurrence of an appointment is moved to the current user (current user's appointments are visible).

    Originally, I did not include any appointments that were not of the current user, but this meant that the current user could not edit the single occurrence of their appointment, because it happened to be part of a series that originally belonged to another user.

    Now, my scheduler loads in all appointments for the current user, and also includes any parent appointments, and sets parent appointments that belong to other users to visible=false.

    This seemed to be working, except that the parent has a 'RecurrenceRule', so the scheduler automatically parses the rule and builds the recurring appointments.  The recurring appointments are visible, even though the parent is visible=false.  How can I force the parsed recurring appointments to be visible=false?

    I tried setting the parent RecurrenceRule to null in AppointmentDataBound, and that prevents the recurring appointments for other users from being generated, but when you delete the current user's single occurrence, it throws an exception that the scheduler could not parse the parent RecurrenceRule (not surprisingly since I manually removed it).

    Any ideas?
  2. Plamen
    Plamen avatar
    3079 posts

    Posted 29 Sep 2011 Link to this post

    Hello Kevin,

    You can try to do a validation similar to this in the Appointment DataBound event:
    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
           if (e.Appointment.RecurrenceState!=RecurrenceState.NotRecurring)
               e.Appointment.Visible = false;

    This code hides all the recurring appointments at my side.

    hope this will be helpful.

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