Back to Devexpress

PersistentObjectCancelEventArgs.Cancel Property

corelibraries-devexpress-dot-xtrascheduler-dot-persistentobjectcanceleventargs.md

latest3.1 KB
Original Source

PersistentObjectCancelEventArgs.Cancel Property

Gets or sets whether to cancel the operation.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.Core.dll

NuGet Package : DevExpress.Scheduler.Core

Declaration

csharp
public bool Cancel { get; set; }
vb
Public Property Cancel As Boolean

Property Value

TypeDescription
Boolean

true to cancel the operation performed on the event; otherwise, false.

|

Remarks

Set the Cancel parameter to true to cancel the processing of an event. Use this to cancel the loading, inserting or deleting of either appointments or resources.

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

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.

winforms-scheduler-create-appointment-edit-form-with-custom-fields/CS/SimpleCustomFields/Form1.cs#L73

csharp
private void SchedulerStorage1_AppointmentInserting(object sender, PersistentObjectCancelEventArgs e) {
    if (((Appointment)e.Object).Start < DateTime.Now) e.Cancel = true;
}

asp-net-web-forms-create-responsive-web-app/CS/ResponsiveWebApplication/Scheduler.aspx.cs#L35

csharp
if(ResourcesListBox.SelectedValues.Count == 0)
    e.Cancel = true;
else {

winforms-scheduler-create-appointment-edit-form-with-custom-fields/VB/SimpleCustomFields/Form1.vb#L74

vb
If CType(e.Object, Appointment).Start < Date.Now Then
    e.Cancel = True
End If

See Also

PersistentObjectCancelEventArgs Class

PersistentObjectCancelEventArgs Members

DevExpress.XtraScheduler Namespace