windowsforms-devexpress-dot-xtrascheduler-dot-schedulercontrol-ed1bf8c5.md
When you disable the TimeRegion.Editable setting, users are unable to create or modify existing appointments so that they belong to this region. Handle this event and override its e.Editable parameter to remove restrictions for specific appointments and/or users.
Namespace : DevExpress.XtraScheduler
Assembly : DevExpress.XtraScheduler.v25.2.dll
NuGet Package : DevExpress.Win.Scheduler
public event EventHandler<TimeRegionCustomizeEventArgs> TimeRegionCustomize
Public Event TimeRegionCustomize As EventHandler(Of TimeRegionCustomizeEventArgs)
The TimeRegionCustomize event's data class is DevExpress.XtraScheduler.TimeRegionCustomizeEventArgs.
The code below is taken from the Scheduler Demo, where the “Lunch” time region (1p.m.~2p.m.) does not accept any appointments unless they have the “Out of Office” status.
scheduler.TimeRegionCustomize += (s, e) => {
if (e.Appointment == null)
return;
if (e.Appointment.StatusKey.Equals(3))
e.Editable = true;
};
AddHandler scheduler.TimeRegionCustomize, Sub(s, e)
If e.Appointment Is Nothing Then
Return
End If
If e.Appointment.StatusKey.Equals(3) Then
e.Editable = True
End If
End Sub
See Also