windowsforms-devexpress-dot-xtrascheduler-dot-schedulercontrol-b09d4fdc.md
Allows you to assign custom values to HTML elements bound to data fields.
Namespace : DevExpress.XtraScheduler
Assembly : DevExpress.XtraScheduler.v25.2.dll
NuGet Package : DevExpress.Win.Scheduler
public event EventHandler<CustomAppointmentTemplateValueEventArgs> CustomAppointmentTemplateValue
Public Event CustomAppointmentTemplateValue As EventHandler(Of CustomAppointmentTemplateValueEventArgs)
The CustomAppointmentTemplateValue event's data class is DevExpress.XtraScheduler.CustomAppointmentTemplateValueEventArgs.
You can use the ${} syntax to bind HTML elements to data source or Appointment fields (for example, `` 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";
}
Private Sub OnCustomAppointmentTemplateValue(ByVal sender As Object, ByVal e As CustomAppointmentTemplateValueEventArgs)
If e.Appointment.Description = String.Empty AndAlso e.FieldName = "Appointment.Description" Then
e.FieldValue = "No Details"
End If
End Sub
Refer to this help article for more information: HTML Templates in Scheduler.
See Also