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

Getting Appointment from Occurrence?

3 Answers 150 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 03 Jul 2011, 11:10 PM
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.

Cheers,
Scott

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 05 Jul 2011, 01:29 PM
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,
Yana
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!
0
Simon
Top achievements
Rank 1
answered on 06 Nov 2012, 10:35 PM
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?

Regards,
Simon
0
Yana
Telerik team
answered on 09 Nov 2012, 03:57 PM
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,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ScheduleView
Asked by
Scott
Top achievements
Rank 1
Answers by
Yana
Telerik team
Simon
Top achievements
Rank 1
Share this question
or