windowsforms-devexpress-dot-xtrascheduler-dot-schedulercontrol-e96657e3.md
Allows you to assign unique HTML templates to individual Appointments.
Namespace : DevExpress.XtraScheduler
Assembly : DevExpress.XtraScheduler.v25.2.dll
NuGet Package : DevExpress.Win.Scheduler
public event QueryAppointmentTemplateEventHandler QueryAppointmentTemplate
Public Event QueryAppointmentTemplate As QueryAppointmentTemplateEventHandler
The QueryAppointmentTemplate event's data class is DevExpress.XtraScheduler.QueryAppointmentTemplateEventArgs.
The following sample applies the “OffDutyTimeAppTemplate” for all regular Day View appointments that start at 5 p.m. or later:
private void SchedulerControl1_QueryAppointmentTemplate(object sender, QueryAppointmentTemplateEventArgs e) {
SchedulerControl scheduler = sender as SchedulerControl;
if (scheduler.ActiveViewType == SchedulerViewType.Day && e.Appointment.Type == AppointmentType.Normal &&
e.Appointment.Start.Hour >= 17)
e.Template.Assign(OffDutyTimeAppTemplate);
}
Private Sub SchedulerControl1_QueryAppointmentTemplate(ByVal sender As Object, ByVal e As QueryAppointmentTemplateEventArgs)
Dim scheduler As SchedulerControl = TryCast(sender, SchedulerControl)
If scheduler.ActiveViewType = SchedulerViewType.Day AndAlso e.Appointment.Type = AppointmentType.Normal AndAlso e.Appointment.Start.Hour >= 17 Then
e.Template.Assign(OffDutyTimeAppTemplate)
End If
End Sub
Refer to this help article for more information: HTML Templates in Scheduler.
See Also