- 2 minutes to read
Time rulers are used to indicate time intervals in the Day View, Work-Week View and Full Week View.Views views. A view can display several time rulers at the same time. A time ruler corresponds to the TimeRuler class. Time rulers of a view are accessible using the DayView.TimeRulers property.
A time ruler can show the following elements.
- A TimeRuler.Caption, which is used to indicate a time zone or a geographical region.
- The Time Marker, which points to the current time (use the TimeRuler.TimeMarkerVisibility property to specify its visibility for a particular time ruler, or the DayView.TimeMarkerVisibility property to specify it for all time rulers with the TimeRuler.TimeMarkerVisibility property set to null).
- Minutes, if the TimeRuler.ShowMinutes property is set to true.
- ‘More’ buttons are shown to indicate that the DayView.VisibleTime extends beyond the displayed area. You can click these buttons to scroll the view.
The image below illustrates a Day View displaying three time rulers with different settings.
The following table lists several properties that affect time ruler appearance.
The DayViewAppearance.TimeRuler, DayViewAppearance.TimeRulerHourLine, DayViewAppearance.TimeRulerLine, DayViewAppearance.TimeRulerNowArea, DayViewAppearance.TimeRulerNowLine properties specify the appearance settings used to paint a time ruler. If a scheduler control is painted in the WindowsXP or Skin style, the appearance settings used to paint the time rulers are ignored.
The TimeRuler.HorizontalAlignment property specifies whether the Time ruler is displayed on the left (default for Left-to-Right layout) or on the right side of the view.
The ITimeRulerFormatStringService interface enables you to custom format the text of time labels within the Time Ruler.
Custom Draw Event
SchedulerControl.CustomDrawDayViewTimeRuler. Handle this event to take over the control’s painting process, changing elements of appearance that are not available using properties.
Time Zone Support
Use the TimeRuler.TimeZoneId property to specify the time zone for which the time is displayed. The TimeRuler.UseClientTimeZone property specifies that the time zone of the Time ruler follows the time zone of the Scheduler.