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

Recurrence in Scheduler with custom appointments

1 Answer 121 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Paco
Top achievements
Rank 1
Paco asked on 25 Nov 2015, 01:56 PM
Hi,

I’m experiencing some issue when using Windows Forms RAD Controls 2012 Q1 SP1 suite. Actually I can’t figure out how to solve a problem concerning the use of Scheduler control.

Since my project requires custom fields when adding appointments, I’ve decided to implement a custom appointment class. Everything works fine unless I configure a recurrence in some given appointment.

When I handle AppointmentFormatting event and it has been triggered after adding some recurrence to some appointment, once I access the appointment though e.Appointment the so-called appointed isn’t only upcasted to Appointment base class, but its actual type is also Appointment instead of my custom class (f.e. CustomAppointment).

What am I missing? I can’t figure out why other editing actions on the same appointment (or whatever one I try to edit) will receive an instance of CustomAppointment and a recurrence change provides an instance of Appointment.

Thank you in advance for your effort.

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 27 Nov 2015, 02:16 PM
Hi Paco,

Thank you for writing.

Most probably you are missing an override of the CreateOccurrenceInstance method in your custom implementation of the Appointment class. Besides this method override, you would also need to create a factory generating this type of appointments and assign to the AppointmentFactory property of the scheduler. An example creating a custom appointment is discussed here: http://www.telerik.com/help/winforms/scheduler-appointments-and-dialogs-adding-a-custom-field-to-the-editappointment-dialog.html.

I am sending you attached a sample project demonstrating how the described above can be implemented. I have also created a custom AppointmentElement object which retrieves data from the newly added properties of the custom appointment class so that they can be visualized in the scheduler cells. Additional information is available in the following documentation article: http://www.telerik.com/help/winforms/scheduler-fundamentals-scheduler-element-provider.html. Please note that with our Q2 2014 release we introduced many improvements in RadScheduler and the suggested in the documentation approach considering the appointment element is valid for that and the later versions only.

Besides the attached project, I am also sending you a short video showing the result on my end.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Paco
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or