Skip to main content

SchedulerControl.CreateAppointment(Boolean, Boolean) Method

Invokes the dialog for editing a newly created appointment. Allows you to initialize the editors as the Appointment.AllDay option suggests and show the Appointment Recurrence Form for a recurring appointment.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.1.dll

NuGet Package: DevExpress.Win.Scheduler

Declaration

public void CreateAppointment(
    bool allDay,
    bool recurring
)

Parameters

Name Type Description
allDay Boolean

true if the appointment being created will be Appointment.AllDay; otherwise, false.

recurring Boolean

true if the appointment being created will be recurring; otherwise, false.

Remarks

The Edit Appointment dialog is displayed with the following appointment settings:

Property Value
Appointment.AllDay The value of the allday method parameter.
Appointment.Start The start of the time interval currently selected in the active view of the Scheduler. This time interval can be obtained using the SchedulerViewBase.SelectedInterval property of the SchedulerControl.ActiveView.
Appointment.End The end of the time interval currently selected in the active view of the Scheduler. This time interval can be obtained using the SchedulerViewBase.SelectedInterval property of the SchedulerControl.ActiveView.
Appointment.ResourceId The identifier of the currently selected resource (a resource returned by the SchedulerViewBase.SelectedResource property of the SchedulerControl.ActiveView).
StatusKey AppointmentStatusType.Free

The CreateAppointment method can be used in place of the method listed in the table below. Columns allday and recurring show the CreateAppointment method parameters required to invoke the Edit Appointment dialog in exactly the same way as the method in the first column does.

Method All-Day Recurring
SchedulerControl.CreateNewAppointment false false
SchedulerControl.CreateNewRecurringAppointment false true
SchedulerControl.CreateNewAllDayEvent true false
SchedulerControl.CreateNewRecurringEvent true true

Tip

To create a new appointment in code, use the SchedulerStorageBase.CreateAppointment method.

Note

Use the SchedulerOptionsCustomization.AllowAppointmentCreate option to restrict appointment creation. A new appointment cannot be created if this option is set to UsedAppointmentType.None.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CreateAppointment(Boolean, Boolean) method.

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