ASPxScheduler.InitAppointmentDisplayText Event
Allows you to specify custom appointment text and a description.
Namespace: DevExpress.Web.ASPxScheduler
Assembly: DevExpress.Web.ASPxScheduler.v24.2.dll
Declaration
Event Data
The InitAppointmentDisplayText event's data class is AppointmentDisplayTextEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Appointment | Provides access to the appointment for which the SchedulerControl.InitAppointmentDisplayText event is fired. |
Description | Gets or sets the text that will be displayed as an appointment’s description. |
Text | Gets or sets the text that will be displayed as the appointment’s text (subject and location together). |
ViewInfo | Provides access to the characteristics of the appointment prepared for display. |
Remarks
The InitAppointmentDisplayText
event occurs before an appointment is rendered when its text and description are initialized. This event allows you to display custom text and description in appointments.
protected void ASPxScheduler1_InitAppointmentDisplayText(object sender, AppointmentDisplayTextEventArgs e) {
ASPxScheduler scheduler = sender as ASPxScheduler;
if(scheduler.ActiveViewType == SchedulerViewType.WorkWeek) {
string apptDescription = e.Description.Trim() != "" ? e.Description.Trim() : "<EMPTY DESCRIPTION>";
string apptType = e.Appointment.Type.ToString();
string apptCustomField = e.Appointment.CustomFields["SomeField"] != null ? e.Appointment.CustomFields["SomeField"].ToString() : "<EMPTY FIELD>";
e.Text = String.Format("{0}\r\n{1}\r\n{2}\r\n{3}", e.ViewInfo.Appointment.Subject, apptDescription, apptType, apptCustomField);
}
}
See Also