Skip to main content

TimeRuler Class

A time ruler.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v22.1.Core.Desktop.dll


public class TimeRuler :

The following members return TimeRuler objects:

Library Related API Members
WinForms Controls DayViewTimeRuler.TimeRuler
WPF Controls CustomizeTimeRulerFormEventArgs.TimeRuler
ASP.NET MVC Extensions MVCxTimeRulerCollection.Add()


Time rulers are used to display the time of the view’s visible interval which is specified by the DayView.VisibleTime property. Day Views allow an unlimited number of time rulers to be displayed. They hold their time rulers within their DayView.TimeRulers collection. The picture below demonstrates a time ruler in WinForms Scheduler Control:


A visual element indicating current time may have different names (time slider in WinForms, time marker in ASP.NET, time indicator in WPF and Silverlight).

The time ruler’s TimeRuler.Caption property specifies the ruler’s caption. Commonly, captions are used to indicate a time zone or geographical region whose standard time a ruler displays. A time zone whose standard time a time ruler displays is specified by the TimeRuler.TimeZoneId property. The TimeRuler.TimeMarkerVisibility property specifies whether the time marker that indicates the current time is displayed in the TimeRuler. The TimeRuler.ShowMinutes property allows you to specify whether minutes are displayed on the time ruler scale.

To change time format used in the TimeRuler, substitute the TimeRulerFormatStringService service with your custom implementation.

It’s also possible to specify whether the time ruler maintains daylight-saving time. Use the TimeRuler.AdjustForDaylightSavingTime property for this purpose.

Time rulers in WinForms XtraScheduler control can be custom painted. Handle the SchedulerControl.CustomDrawDayViewTimeRuler event for this purpose. Other platforms require template customization techniques.

The following code snippets (auto-collected from DevExpress Examples) contain references to the TimeRuler class.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.



See Also