Skip to main content

SchedulerControl.CustomAppointmentBackground Event

Allows you to customize the appointments’ appearance by changing their background color.

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v24.1.dll

NuGet Package: DevExpress.Wpf.Scheduling

Declaration

[Browsable(false)]
public event CustomAppointmentBackgroundEventHandler CustomAppointmentBackground

Event Data

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

Property Description
AppointmentItem Provides access to the current appointment.
Background Gets or sets a background color for the appointment.
SourceObject Provides access to the appointments’ source object.

Remarks

The CustomAppointmentBackground event is raised when the Scheduler is loaded. Handle the CustomAppointmentBackground event to change the background color of the desired appointments. Access the appointment using the CustomAppointmentBackgroundEventArgs.AppointmentItem property. Use the CustomAppointmentBackgroundEventArgs.Background property to change the background color.

Example

View Example

Private Sub SchedulerControl_CustomAppointmentBackground(ByVal sender As Object, ByVal e As CustomAppointmentBackgroundEventArgs)
    'Change the recurrent appointments' background to blanched almond color,
    'and other appointments - to rosy brown 
    e.Background = If(e.AppointmentItem.Type = AppointmentType.Occurrence, New SolidColorBrush(Colors.BlanchedAlmond), New SolidColorBrush(Colors.RosyBrown))

    'Change all-day appointments' background:
    e.Background = If(e.AppointmentItem.AllDay = True, New SolidColorBrush(Colors.Tomato), e.Background)
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomAppointmentBackground 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