Recurrence in Scheduler with custom appointments

2 posts, 0 answers
  1. Paco
    Paco avatar
    1 posts
    Member since:
    Apr 2015

    Posted 25 Nov 2015 Link to this post

    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.
  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 27 Nov 2015 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top