Formatting Services
- 2 minutes to read
Different parts of the application may require different formatting, especially for time and dates. A set of services is implemented to facilitate this task regarding the XtraScheduler Suite. These services are:
TimeRulerFormatStringService
ITimeRulerFormatStringService interface provides the means to custom format the text of time labels within the Time Ruler. You can override the following methods, substituting the service with its custom descendant:
- GetHourFormat(TimeRuler ruler)
- GetHalfDayHourFormat(TimeRuler ruler)
- GetHourOnlyFormat(TimeRuler ruler)
- GetTimeDesignatorOnlyFormat(TimeRuler ruler)
- GetMinutesOnlyFormat(TimeRuler ruler)
These methods should return a format string specifying how to display a corresponding visual element. The location of elements within the time ruler is illustrated below.
TimeSlot.Value is 60 minutes:
TimeSlot.Value is 30 minutes:
HeaderCaptionService
IHeaderCaptionService interface enables you to change the captions of the headers in different views. You can override the following methods, substituting the service with its custom descendant:
- string GetDayColumnHeaderCaption(DevExpress.Web.ASPxScheduler.Rendering.WebDateHeader header)
- string GetDayOfWeekHeaderCaption(DevExpress.Web.ASPxScheduler.Rendering.WebDayOfWeekHeader header)
- string GetHorizontalWeekCellHeaderCaption(DevExpress.Web.ASPxScheduler.Rendering.WebDateCellHeader header)
- string GetTimeScaleHeaderCaption(DevExpress.Web.ASPxScheduler.Rendering.WebTimeScaleHeader header)
- string GetVerticalWeekCellHeaderCaption(DevExpress.Web.ASPxScheduler.Rendering.WebDateCellHeader header)
The overridden method should return a format string specifying what to display in a header caption in the corresponding view.
HeaderToolTipService
IHeaderToolTipService interface allows you to specify custom tooltips for the day headers. You can override the following methods, substituting the service with its custom descendant:
- string GetDayColumnHeaderToolTip(DevExpress.Web.ASPxScheduler.Rendering.WebDateHeader header)
- string GetDayOfWeekHeaderToolTip(DevExpress.Web.ASPxScheduler.Rendering.WebDayOfWeekHeader header)
- string GetTimeScaleHeaderToolTip(DevExpress.Web.ASPxScheduler.Rendering.WebTimeScaleHeader header)
- string GetHorizontalWeekCellHeaderToolTip(DevExpress.Web.ASPxScheduler.Rendering.WebDateCellHeader header)
- string GetVerticalWeekCellHeaderToolTip(DevExpress.Web.ASPxScheduler.Rendering.WebDateCellHeader header)
Overridden methods should return a format string specifying how to display a header’s tooltip in the corresponding view.
AppointmentFormatStringService
IAppointmentFormatStringService interface provides the means to customize the time display format used in the visual representation of appointments. You can override the following methods, substituting the service with its custom descendant:
- GetHorizontalAppointmentStartFormat(IAppointmentViewInfo aptViewInfo);
- GetHorizontalAppointmentEndFormat(IAppointmentViewInfo aptViewInfo);
- GetVerticalAppointmentStartFormat(IAppointmentViewInfo aptViewInfo) - applicable to the Timeline View;
- GetVerticalAppointmentEndFormat(IAppointmentViewInfo aptViewInfo) - applicable to the Timeline View;
- GetContinueItemStartFormat(IAppointmentViewInfo aptViewInfo) - applicable if AppointmentDisplayOptions.ContinueArrowDisplayType is AppointmentContinueArrowDisplayType.ArrowWithText;
- GetContinueItemEndFormat(IAppointmentViewInfo aptViewInfo) - applicable if AppointmentDisplayOptions.ContinueArrowDisplayType is AppointmentContinueArrowDisplayType.ArrowWithText;
Overridden methods should return a format string specifying how to display a day header’s tooltip in the corresponding view. The method for using this service is the same as described for the services above.