Skip to main content

SchedulerControl.EditAppointmentFormShowing Event

Occurs before the Edit Appointment dialog window is invoked.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.1.dll

NuGet Package: DevExpress.Win.Scheduler

Declaration

public event AppointmentFormEventHandler EditAppointmentFormShowing

Event Data

The EditAppointmentFormShowing event's data class is AppointmentFormEventArgs. The following properties provide information specific to this event:

Property Description
Appointment Gets the appointment for which the dialog will be shown.
CommandSourceType Indicates the mechanism of the command input, e.g. keyboard, mouse, menu.
DialogResult Gets or sets the return value of a dialog box. Inherited from ShowFormEventArgs.
Handled Gets or sets whether an event was handled, if it was handled the default actions are not required. Inherited from ShowFormEventArgs.
OpenRecurrenceForm Gets a value indicating whether the Appointment Recurrence form is displayed on the top of the Edit Appointment form.
Parent Gets or sets a parent of the form being shown. Inherited from ShowFormEventArgs.
ReadOnly Gets a value indicating whether an appointment is read-only.

Remarks

Handle the EditAppointmentFormShowing event to perform any actions prior to the Edit Appointment dialog being shown. For instance, a custom dialog can be substituted in place of the standard one.

This dialog can be invoked either by an end-user, or via the SchedulerControl.ShowEditAppointmentForm method. Note that the appointment which will be edited in this dialog window can be specified via the AppointmentFormEventArgs.Appointment property.

To learn how to create a custom appointment editing form, review the Getting Started document.

Example

The following example demonstrates how to substitute the standard Edit Appointment dialog window with a custom form. Handle the SchedulerControl.EditAppointmentFormShowing event (which occurs before the Edit Appointment dialog window is invoked) and show your own custom form. Set the ShowFormEventArgs.Handled property to true, to prevent the standard form from displaying.

View Example

private void schedulerControl1_EditAppointmentFormShowing(object sender, AppointmentFormEventArgs e)
{
    MyAppointmentForm form = new MyAppointmentForm(sender as SchedulerControl, e.Appointment, e.OpenRecurrenceForm);
    try
    {
        e.DialogResult = form.ShowDialog();
        e.Handled = true;
    }
    finally
    {
        form.Dispose();
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the EditAppointmentFormShowing event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also