Scheduler - Recurrence Editor

Hi,

I can't find the RecurrenceEditor control in the WPF library.

There is one in the Blazor library which works perfectly, I need to create a custom appointment edit window with the recurrence editor on the form. What's the best way to do this using the WPF library? 

Thanks in advance, Lee.


9 Replies

SS SaiGanesh Sakthivel Syncfusion Team March 14, 2022 02:21 PM UTC

Hi Lee, 
 
#Regarding Recurrence Editor  
Currently, we are checking the reported query from our end. we will update you on the further details on 16 March, 2022. We appreciate the patience until then. 
 
Regards,
SaiGanesh Sakthivel
 



SS SaiGanesh Sakthivel Syncfusion Team March 16, 2022 03:03 PM UTC

Hi Lee, 
 
#Regarding Custom Recurrence Editor in WPF 
As per the implementation of SfScheduler, you can add the own custom appointment editor in the sfschedule with help of AppointmentEditoropening event. Please refer to the following KB documentation for your reference. 
 
 
We need more information of ‘What exactly you mention the RecurrenceEditor control library’. Could you please share the code snippet of blazor schedule or image of your requirement to achieve in WPF Scheduler which would help us to provide the better solution? 
 
Regards,
SaiGanesh Sakthivel
 



LS Lee Stevens March 17, 2022 02:34 PM UTC

Hi SaiGanesh,

We just need a control to amend the recurrence rule. The built in appointment editor in the WPF library has the recurrence editor on it, is this not encapsulated within its own control?

On blazor, you simply do the following to display a recurrence editor:


 <SfRecurrenceEditor @bind-Value="@vm.Model.RecurrenceRule"

                                       StartDate="@vm.Model.DStart.DateTime" />


I cannot find the equivalent in the wpf library, however as mentioned above the functionality is obviously there as it is present on the default appointment edit form from your demo. (Screenshot attached)

Thanks, Lee.


Attachment: Syncfusion__Recurrence_Edit_WPF_8e453505.zip


SS SaiGanesh Sakthivel Syncfusion Team March 18, 2022 01:36 PM UTC

Hi Lee, 
  
#Regarding Custom Recurrence Editor in WPF 
Currently, we are analysis the reported query from our end. We will update you the further details on the March 22, 2022. We appreciate the patience until then. 
 
Regards,
SaiGanesh Sakthivel
 



SS SaiGanesh Sakthivel Syncfusion Team March 22, 2022 12:47 PM UTC

Hi Lee, 
 
#Regarding RecurrenceEditor in custom Appointment Editor 
Your requirement can be achieved with the help of RecurrenceProperties in the SfScheduler. You can get the recurrence properties value of appointment with the help of RecurrenceHelper Class. With the help of RecurrenceHelper, you can get the recurrence properties of the appointment to display in the CustomAppointment Editor. Please refer to the following code snippet for your reference. We have created the demo sample of CustomAppointment editor with Daily Reccurence. 
 
Code snippet 
if (appointment.IsRecursive) 
    { 
        var id = appointment.Type == AppointmentType.ChangedOccurrence ? appointment.RecurrenceId : appointment.Id; 
        var parentAppointment = (ScheduleAppointment)this.GetParentAppointment(id); 
        this.appointment = parentAppointment; 
        SchedulerRecurrenceProperties = RecurrenceHelper.RRuleParser(appointment.RecurrenceRule, appointment.StartTime); 
        if (SchedulerRecurrenceProperties.RecurrenceType == RecurrenceType.Daily) 
        { 
            this.Repeat.Visibility = Visibility.Visible; 
            this.Repeat.Value = SchedulerRecurrenceProperties.Interval; 
            this.Recurrence.Text = "Daily"; 
 
            if (SchedulerRecurrenceProperties.RecurrenceRange == RecurrenceRange.NoEndDate) 
            { 
                this.DailyRecurrenceUntil.Visibility = Visibility.Collapsed; 
                this.DailyRecurrenceRepeat.Visibility = Visibility.Collapsed; 
                this.End.Text = "Never"; 
            } 
            else if (SchedulerRecurrenceProperties.RecurrenceRange == RecurrenceRange.EndDate) 
            { 
                this.DailyRecurrenceUntil.Visibility = Visibility.Visible; 
                this.DailyRecurrenceRepeat.Visibility = Visibility.Collapsed; 
                this.DailyRecurrenceUntil.Value = SchedulerRecurrenceProperties.EndDate; 
                this.End.Text = "UNTIL"; 
            } 
            else 
            { 
                this.DailyRecurrenceUntil.Visibility = Visibility.Collapsed; 
                this.DailyRecurrenceRepeat.Visibility = Visibility.Visible; 
                this.DailyRecurrenceRepeat.Value = SchedulerRecurrenceProperties.RecurrenceCount; 
                this.End.Text = "Count"; 
            } 
        } 
    } 
    else 
    { 
        this.Recurrence.Text = "Never"; 
        this.End.Text = "Never"; 
        this.Repeat.Visibility = Visibility.Collapsed; 
        this.End.Visibility = Visibility.Collapsed; 
        this.DailyRecurrenceUntil.Visibility = Visibility.Collapsed; 
        this.DailyRecurrenceRepeat.Visibility = Visibility.Collapsed; 
    } 
 
OnSaveButton 
private void OnSaveClicked(object sender, RoutedEventArgs e) 
{ 
    if (appointment == null) 
    { 
        var scheduleAppointment = new ScheduleAppointment(); 
        scheduleAppointment.Subject = this.Subject.Text; 
        scheduleAppointment.StartTime = this.StartDatePicker.Value.Value.Date.Add(this.StartTimePicker.Value.Value.TimeOfDay); 
        scheduleAppointment.EndTime = this.EndDatePicker.Value.Value.Date.Add(this.EndTimePicker.Value.Value.TimeOfDay); 
        scheduleAppointment.Location = this.location.Text; 
        scheduleAppointment.IsAllDay = (bool)this.allDay.IsChecked; 
        scheduleAppointment.Notes = this.description.Text; 
             
        scheduleAppointment.Reminders = (ObservableCollection<SchedulerReminder>)this.ReminderList.ItemsSource; 
 
        if ((bool)this.timeZone.IsChecked) 
        { 
            scheduleAppointment.StartTimeZone = this.TimeZoneMenu.Text; 
            scheduleAppointment.EndTimeZone = this.TimeZoneMenu.Text; 
        } 
        if (this.scheduler.ItemsSource == null) 
        { 
            this.scheduler.ItemsSource = new ScheduleAppointmentCollection(); 
        } 
        if (this.Recurrence.Text != "Never") 
        { 
            if (this.DailyRecurrenceRepeat.Value != null) 
            { 
                SchedulerRecurrenceProperties.RecurrenceCount = (int)this.DailyRecurrenceRepeat.Value; 
            } 
            if (this.Repeat.Value != null) 
            { 
                SchedulerRecurrenceProperties.Interval = (int)this.Repeat.Value; 
            } 
            if (this.DailyRecurrenceUntil.Value >= scheduleAppointment.StartTime.Date) 
            { 
                SchedulerRecurrenceProperties.EndDate = (DateTime)this.DailyRecurrenceUntil.Value; 
            } 
 
            scheduleAppointment.RecurrenceRule = RecurrenceHelper.CreateRRule(SchedulerRecurrenceProperties, scheduleAppointment.StartTime, scheduleAppointment.EndTime); 
        } 
                 
            (this.scheduler.ItemsSource as ScheduleAppointmentCollection).Add(scheduleAppointment); 
    } 
    else 
    { 
        appointment.Subject = this.Subject.Text; 
        appointment.StartTime = this.StartDatePicker.Value.Value.Date.Add(this.StartTimePicker.Value.Value.TimeOfDay); 
        appointment.EndTime = this.EndDatePicker.Value.Value.Date.Add(this.EndTimePicker.Value.Value.TimeOfDay); 
        appointment.Location = this.location.Text; 
        appointment.IsAllDay = (bool)this.allDay.IsChecked; 
        appointment.Notes = this.description.Text; 
        appointment.Reminders = (ObservableCollection<SchedulerReminder>)this.ReminderList.ItemsSource; 
        appointment.StartTimeZone = this.TimeZoneMenu.Text; 
        appointment.EndTimeZone = this.TimeZoneMenu.Text; 
                 
        if (this.Recurrence.Text != "Never") 
        { 
            if (this.DailyRecurrenceRepeat.Value != null) 
            { 
                SchedulerRecurrenceProperties.RecurrenceCount = (int)this.DailyRecurrenceRepeat.Value; 
            } 
            if (this.Repeat.Value != null) 
            { 
                SchedulerRecurrenceProperties.Interval = (int)this.Repeat.Value; 
            } 
            if (this.DailyRecurrenceUntil.Value >= appointment.StartTime.Date) 
            { 
                SchedulerRecurrenceProperties.EndDate = (DateTime)this.DailyRecurrenceUntil.Value; 
            } 
 
            appointment.RecurrenceRule = RecurrenceHelper.CreateRRule(SchedulerRecurrenceProperties, appointment.ActualStartTime, appointment.ActualEndTime);     
        } 
        else if (this.Recurrence.Text == "Never") 
        { 
            appointment.RecurrenceRule = string.Empty; 
        } 
    } 
    this.Close(); 
} 
 
Please refer to the demo sample in the following locations. 
 
Please let us know if you have any concerns. 
 
Regards,
SaiGanesh Sakthivel



LS Lee Stevens March 22, 2022 09:00 PM UTC

Hi SaiGanesh,


I don't think you have understood my question as the above information isn't relevant.


On the default appointment form, as you have it in the demo you have sent, there is a control to select the recurrence type and then amend the options for that type; See my previous screenshot which highlighted the area on the form in red. 


Where is that control in the WPF Library? The blazor library has one, you are using the control (Or at least something to amend the recurrence of the events) on your default form so it must be there.

Lee.



SS SaiGanesh Sakthivel Syncfusion Team March 23, 2022 12:40 PM UTC

Hi Lee, 
 
#Regarding Recurrence Editor Library 
As per the implementation of SfScheduler, we do not have a separate recurrence library. We are using the recurrence properties to create the respective recurrence UI and display it in the appointment editor. With the help of the RecurrenceHelper class, you can get the recurrence properties of the appointment. 
 
Regards,
SaiGanesh Sakthivel



LS Lee Stevens March 29, 2022 08:02 AM UTC

Hi SaiGanesh,

This is dissapointing to hear. Not sure why the Blazor library has this control and the WPF library doesn't. 
It would surely be a case of encapsulating the recurrence section from the appointment editor? 


Otherwise users have to write their own control for what is a standard rule pattern.


Lee.



SS SaiGanesh Sakthivel Syncfusion Team March 30, 2022 01:48 PM UTC

Hi Lee,


#Regarding Recurrence Editor Library

As we have mentioned in the previous update, we do not have a separate recurrence library as in the scenario of adding any customized editor for the recurrence editor. You can use the recurrence properties to bind the values in a custom control to the recurrence editor, just like the subject, start, and end time properties are bound to the custom editors.


Regards,
SaiGanesh Sakthivel


Loader.
Up arrow icon