Skip to main content
All docs
V23.2

SchedulerControl.CustomAppointmentTemplateValue Event

Allows you to assign custom values to HTML elements bound to data fields.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v23.2.dll

NuGet Package: DevExpress.Win.Scheduler

Declaration

public event EventHandler<CustomAppointmentTemplateValueEventArgs> CustomAppointmentTemplateValue

Event Data

The CustomAppointmentTemplateValue event's data class is DevExpress.XtraScheduler.CustomAppointmentTemplateValueEventArgs.

Remarks

You can use the ${} syntax to bind HTML elements to data source or Appointment fields (for example, <img src="${DataSource.Photo}"> or <div>${Appointment.CustomFields.Position}</div>). You can handle the CustomAppointmentTemplateValue event to replace values retrieved by such data-bound elements.

Use the e.Appointment and e.FieldName properties to find a placeholder for data-bound values, and set the e.FieldValue property to assign your custom value.

The following sample assigns the “No Details” description to appointments that do not have any descriptions.

...
<div>${Appointment.Description}</div>
...
private void OnCustomAppointmentTemplateValue(object sender, CustomAppointmentTemplateValueEventArgs e) {
    if (e.Appointment.Description == String.Empty && e.FieldName == "Appointment.Description")
        e.FieldValue = "No Details";
}

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

See Also