Allows you to customize the appointments' appearance by changing their background color.
[Browsable(false)] public event CustomAppointmentBackgroundEventHandler CustomAppointmentBackground
<Browsable(False)> Public Event CustomAppointmentBackground As CustomAppointmentBackgroundEventHandler
The CustomAppointmentBackground event's data class is CustomAppointmentBackgroundEventArgs. The following properties provide information specific to this event:
|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.|
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.
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-handle-the-customappointmentbackground-event-to-change-the-appointments-background-t584687.
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