Getting Appointment from Occurrence?

4 posts, 0 answers
  1. Scott
    Scott avatar
    42 posts
    Member since:
    Feb 2009

    Posted 03 Jul 2011 Link to this post

    Hi All,

    How does one get a reference to the "master" or "parent" of an appointment occurrence?

    For example, user clicks on an occurrence in the RadScheduleView, the RadScheduleView.SelectedItem returns the IOccurrence object selected by the user. How can I get to the original appointment and all of its properties givin only the IOccurrence object?

    EDIT: The AppointmentEditDialogViewModel's Occurrence property/object has a .Master property as I recall. This is the functionality I need: to determine the "master" appointment given an occurrence.

  2. Yana
    Yana avatar
    5043 posts

    Posted 05 Jul 2011 Link to this post

    Hello Scott,

    You should use Appointment property of the Occurrence in order to get the parent appointment:

    var parentApp = (scheduleView.SelectedAppointment as Occurrence).Appointment;

    Best wishes,
    the Telerik team
    Register for the Q2 2011 What’s New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
  3. Simon
    Simon avatar
    57 posts
    Member since:
    May 2008

    Posted 06 Nov 2012 Link to this post

    Hi Yana,

    Can  you further explain the difference between the Occurrence.Appointment and Occurrence.Master properties? I see that they are sometimes different and sometimes point to the same object. How should we be using these properties?

  4. Yana
    Yana avatar
    5043 posts

    Posted 09 Nov 2012 Link to this post

    Hi Simon,

    Occurrence.Master is always the appointment which holds the RecurrenceRule. Occurrence.Appointment is different for regular occurrences and for exception occurrences: for regular occurrences it is the same as Occurrence.Master and for exception occurrences it is actually the appointment of the exception.

    Hope this clears things up.

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top