How to: Invoke the Default Appointment Recurrence Dialog from a Custom Edit Appointment Form (legacy
3 minutes to read
You are viewing documentation for the legacy WPF Scheduler control. If you're starting a new project, we strongly recommend that you use a new control declared in the DevExpress.Xpf.Scheduling namespace. If you decide to upgrade an existing project in order to switch to the updated scheduler control, see the Migration Guidelines document.
This example demonstrates how to provide end-users with the capability to work with recurring appointments via the standard Appointment Recurrence dialog that should be invoked from a custom Edit Appointment form.
Open the scheduling WPF application created in Lesson 9 of the Getting Started tutorial.
This application contains the scheduler control that is already bound to the required data source. The standard Edit Appointment form is replaced with a custom one. The Appointment Recurrence feature is disabled and custom appointment editing dialog does not allow end-users to invoke the Appointment Recurrence dialog for creating and editing recurring appointments.
Now, recurring appointments contained in the data source are displayed in the scheduler control according to recurrence information specified by patterns. The default context menu includes the New Recurring Appointment and New Recurring Event items, and the recurring appointment context menu includes the Edit Series item, but the Appointment Recurrence dialog is still unavailable for end-users and recurrence patterns cannot still be created and edited.
Private Sub schedulerControl1_RecurrenceFormShowing(sender As Object, _
e As RecurrenceFormEventArgs)
Dim customForm As CustomAppointmentForm = TryCast(e.ParentForm, CustomAppointmentForm)
e.Controller = customForm.Controller
Now, the default Appointment Recurrence form is invoked when an end-user creates a new recurring appointment by selecting New Recurring Appointment or New Recurring Event from the context menu. However, it is still impossible to modify recurrence patterns of existing appointments.
Private Sub Recurrence_button_Click(sender As Object, e As RoutedEventArgs)
Run the project. End-users are provided with the comprehensive functionality for working with appointments of different types (simple and recurring) via the custom Edit Appointment form to specify main and custom appointment properties (Subject, Start, End, Label, Status, etc.) and via the default Appointment Recurrence form to create and modify recurrence patterns.