Articles in this section
Category / Section

How to delete an occurrence from the recurrence appointment series in WPF Scheduler (Calendar)

4 mins read

In the WPF SfScheduler, you can delete an occurrence from the recurrence appointment series by using the RecurrenceExceptionDates property of the ScheduleAppointment.

C#

Add the appointments for the scheduler with the RecurrenceExpcetionDates property of the  appointments.

public class SchedulerViewModel : INotifyPropertyChanged
{
    /// <summary>
    /// Gets or sets appointments
    /// </summary>
    public ScheduleAppointmentCollection Appointments { get; set; }
 
    #region Methods
    /// <summary>
    /// Adding appointments
    /// </summary>
    private void AddAppointments()
    {
        var exceptionDate = new DateTime(2021, 06, 09);
        this.Appointments = new ScheduleAppointmentCollection();
 
        var newEvent = new ScheduleAppointment();
        newEvent.Subject = "Meeting";
        newEvent.StartTime = new DateTime(2021, 06, 2, 10, 0, 0);
        newEvent.EndTime = new DateTime(2021, 06, 2, 11, 0, 0);
        newEvent.RecurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=10";
        newEvent.RecurrenceExceptionDates = new ObservableCollection<DateTime>(){exceptionDate};
        newEvent.AppointmentBackground = Brushes.Green;
 
        this.Appointments.Add(newEvent);
    }
    #endregion
}

XAML

Bind the Appointments to the ItemsSource property of the Scheduler.

<Window.DataContext>
<local:SchedulerViewModel/>
</Window.DataContext>
 
<syncfusion:SfScheduler x:Name="Schedule" 
                    ViewType="Week" 
                    ItemsSource="{Binding Appointments}">
 
</syncfusion:SfScheduler>

View sample in GitHub

Disable the particular occurrence

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied