Last Updated: 27 May 2021 08:53 by ADMIN
Created on: 16 Feb 2017 12:53
Category: Scheduler
Type: Feature Request
getting expanded appointmens in SchedulerProviderBase
In a RadScheduler with a custom provider (inheriting from SchedulerProviderBase), there is no way to get "expanded" appointments (i.e. masters plus occurrences minus exceptions). 

I devised a solution (as suggested in, using the Occurrences property of RecurrenceRule:

        public IEnumerable<Appointment> GetExpandedAppointments(RadScheduler owner, DateTime start, DateTime end)
            var result = new List<Appointment>();

            foreach (Appointment a in this.GetAppointments(owner))
                // see
                if (a.RecurrenceState == RecurrenceState.Master)
                    RecurrenceRule parsedRule;
                    RecurrenceRule.TryParse(a.RecurrenceRule, out parsedRule);
                    parsedRule.SetEffectiveRange(start, end);

                    int nc = 0;
                    foreach (DateTime occurrence in parsedRule.Occurrences)
                        Appointment app = a.Clone();
                        app.ID = a.ID + "_" + ++nc;
                        app.Start = occurrence;
                        app.End = occurrence.Add(a.Duration);
                        app.RecurrenceRule = null;
                        app.RecurrenceParentID = a.ID;
                        app.RecurrenceState = RecurrenceState.Occurrence;
                else if (a.RecurrenceState != RecurrenceState.Occurrence)

            return result;

I think this functionality can be part of SchedulerProviderBase, there is no custom logic.



1 comment
Peter Milchev
Posted on: 27 May 2021 08:53

Hello Mauro,

Thank you for sharing your solution with the community. 

The Scheduler provider needs to provide only the Master, Non-recurring and Exception appointments to the Scheduler, and then the Scheduler will expand the appointment when, and if, it is necessary, based on its settings.

With that said, I would have to decline the request as the SchedulerProviderBase does not need expanding the appointments at all, hence no need to add functionality that is not for this class.

On the other hand, the SchedulerProviderBase is an abstract class, so you would need to inherit it anyway. In your custom class, you can easily plug the shared implementation should it be necessary.

Peter Milchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at