Back to Devexpress

SchedulerControl.QueryAppointmentTemplate Event

windowsforms-devexpress-dot-xtrascheduler-dot-schedulercontrol-e96657e3.md

latest2.3 KB
Original Source

SchedulerControl.QueryAppointmentTemplate Event

Allows you to assign unique HTML templates to individual Appointments.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public event QueryAppointmentTemplateEventHandler QueryAppointmentTemplate
vb
Public Event QueryAppointmentTemplate As QueryAppointmentTemplateEventHandler

Event Data

The QueryAppointmentTemplate event's data class is DevExpress.XtraScheduler.QueryAppointmentTemplateEventArgs.

Remarks

The following sample applies the “OffDutyTimeAppTemplate” for all regular Day View appointments that start at 5 p.m. or later:

csharp
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);
}
vb
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

SchedulerControl Class

SchedulerControl Members

DevExpress.XtraScheduler Namespace