Back to Devexpress

SchedulerControl.CustomizeAppointmentTemplate Event

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

latest2.4 KB
Original Source

SchedulerControl.CustomizeAppointmentTemplate Event

Allows you to hide specific HTML elements at runtime, or change their CSS style properties.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public event CustomizeAppointmentTemplateEventHandler CustomizeAppointmentTemplate
vb
Public Event CustomizeAppointmentTemplate As CustomizeAppointmentTemplateEventHandler

Event Data

The CustomizeAppointmentTemplate event's data class is DevExpress.XtraScheduler.CustomizeAppointmentTemplateEventArgs.

Remarks

Use the e.HtmlElement method to obtain a required HTML element. Once the element is located, change its Hidden property to control the element’s visibility, or call the Style.SetProperty method to modify CSS style properties.

csharp
private void OnCustomizeAppointmentTemplate(object sender, CustomizeAppointmentTemplateEventArgs e) {
    var templateImage = e.HtmlElement.FindElementById("dinner_icon");
    if (...)
        templateImage.Hidden = true; // Hide the HTML element
    templateImage.Style.SetProperty("height", "32px"); // Modify the CSS property
}
vb
Private Sub OnCustomizeAppointmentTemplate(ByVal sender As Object, ByVal e As CustomizeAppointmentTemplateEventArgs)
    Dim templateImage = e.HtmlElement.FindElementById("dinner_icon")
    If ... Then
        templateImage.Hidden = True ' Hide the HTML element
    End If
    templateImage.Style.SetProperty("height", "32px") ' Modify the CSS property
End Sub

Refer to the following help article for more information: HTML Templates in Scheduler.

See Also

SchedulerControl Class

SchedulerControl Members

DevExpress.XtraScheduler Namespace