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

TimelineView.TimeScales Property

Provides access to a collection of time scales available in the Timeline View. This is a dependency property.

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v18.2.dll

Declaration

[Browsable(false)]
public TimeScaleCollection TimeScales { get; set; }

Property Value

Type Description
TimeScaleCollection

A collection containing time scales for the Timeline view.

Remarks

Use the TimeScales property to get access to the collection that stores all time scales of the current Timeline View. An individual item in the collection is represented by the TimeScaleBase class descendant. Use the collection’s methods and properties to add, modify or remove time scales. The available time scales are used in the visible time interval calculations, and you may control whether a particular time scale should be considered using the scale’s IsEnabled property.

The default TimeScaleCollection contains the following items:

Scale Type Description IsEnabled
TimeScaleYear A time scale whose time cell value is equal to a single year. false
TimeScaleQuarter A time scale whose time cell value is equal to a quarter of a year. false
TimeScaleMonth A time scale whose time cell value is equal to a single month. false
TimeScaleWeek A time scale whose time cell value is equal to a single week. true
TimeScaleDay A time scale whose time cell value is equal to a single day. true
TimeScaleHour A time scale whose time cell value is equal to a single hour. false
TimeScaleWorkHour A time scale whose time cell value is equal to a working hour. false

The following picture shows default time scale items in the pop-up menu.

WPFScheduler_Timeline_TimeScales

Tip

You can implement a custom fixed scale using the FixedTimeScale class instance. Specify a custom interval by setting the FixedTimeScale.Scale property.

The following example demonstrates how to specify a custom set of time scales for the Timeline View:

<dxsch:TimelineView x:Name="timelineView" IntervalCount="8">
    <dxsch:TimelineView.TimeScales>
        <dxsch:TimeScaleWeek x:Name="scaleWeek" IsEnabled="False"/>
        <dxsch:TimeScaleWorkDay x:Name="scaleWorkDay" IsEnabled="True"/>
        <dxsch:TimeScaleWorkHour x:Name="scaleWorkHour" IsEnabled="True"/>
        <dxsch:FixedTimeScale x:Name="scaleFixedTime" Caption ="30 minutes" Scale="00:30:00" IsEnabled="True" ShowHeaders="False"/>
    </dxsch:TimelineView.TimeScales>
</dxsch:TimelineView>

The Timeline View also supports binding to a collection of objects containing time scale settings, described in a Model or ViewModel. See the TimelineView.TimeScalesSource, TimelineView.TimeScaleTemplate and TimelineView.TimeScaleTemplateSelector property descriptions to learn more about this approach.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TimeScales property.

Note

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