Skip to main content
A newer version of this page is available. .

Time Scales

  • 2 minutes to read

Overview

The Time Scale elements are inherent to the Timeline View. They appear as rulers with different time scales above the time cell area. The appointment’s position on the time line can be recognized with the help of these elements.

Time scales are contained within the collection accessible by using the TimelineView.Scales property.

TimeScales

Built-in Time Scales

The following built-in classes representing the time scales are available:

The visual appearance of time scale elements can be customized via the TimeScale.DisplayFormat and TimeScale.Width properties. To hide a specific time scale use the TimeScale.Visible property.

You can specify a custom set of scales by clearing the time scale collection and populating it with required scales.

Custom Scales

To create a time scale with an arbitrary fixed interval, create the TimeScaleFixedInterval class instance by using a constructor with a parameter that is the required time interval. The following snippet illustrates how to add a 30 minutes time scale.


using DevExpress.XtraScheduler;
// ...
TimeScaleFixedInterval scale30Minutes = new TimeScaleFixedInterval(TimeSpan.FromMinutes(30));
schedulerControl1.TimelineView.Scales.Add(scale30Minutes);

You can modify the time scale by creating the class inheriting from one of the built-in time scale. This technique is described in the How to: Hide Certain Columns in the Timeline View document.

You can also create a new time scale by inheriting from the TimeScaleFixedInterval class.

Tip

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E1480.

See Also