Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SchedulerControl.CustomAppointmentTemplateValue Event

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

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.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