SchedulerControl.AddAppointments(IEnumerable<AppointmentItem>, Boolean) Method
Adds the specified appointments to the AppointmentItems collection.
Namespace: DevExpress.Xpf.Scheduling
Assembly: DevExpress.Xpf.Scheduling.v20.2.dll
NuGet Packages: DevExpress.WindowsDesktop.Wpf.Scheduling, DevExpress.Wpf.Scheduling
Declaration
public bool AddAppointments(
IEnumerable<AppointmentItem> appointments,
bool showConflictsMessageBox = true
)
Parameters
Name | Type | Description |
---|---|---|
appointments | IEnumerable<AppointmentItem> | A collection of DevExpress.Xpf.Scheduling.AppointmentItem objects to be added to the AppointmentItems collection. |
Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
showConflictsMessageBox | Boolean | True | true, to display the message box that warns about conflicted appointments; otherwise, false. |
Returns
Type | Description |
---|---|
Boolean | true, if the appointments have been added to the AppointmentItems collection; otherwise, false. |
Remarks
The method does not add the specified appointments and returns false in either of the following cases:
- The appointments collection is empty
- It would lead to conflicts restricted by the AllowAppointmentConflicts property and the CustomAllowAppointmentConflicts event
- The Cancel property of your AppointmentAdding event implementation returns true.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AddAppointments(IEnumerable<AppointmentItem>, 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.