Skip to main content

TimeScale Class

Serves as the base class for classes which are time scales in the Timeline View.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v14.2.Core.dll

#Declaration

[TypeConverter(typeof(UniversalTypeConverterEx))]
public abstract class TimeScale :
    UserInterfaceObject,
    INotifyPropertyChanged

#Returned By

The TimelineView.GetBaseTimeScale() method returns an instance of TimeScale.

#Remarks

The TimeScale class provides the TimeScale.Enabled and TimeScale.Visible properties, which define the behavior of a particular time scale when calculating a scheduler control's layout for the Timeline View.

You can inherit from this class to modify the Timeline View by implementing custom time scales. A custom scale allows you to specify arbitrary scale intervals, modify captions and hide certain time intervals.

For the comparatively simple task of creating a scale with a fixed interval, you can inherit from the TimeScaleFixedInterval class. For more complex tasks, use the TimeScale descendants and override key methods.

#Examples

This example illustrates how to access the time scale collection of the Timeline View (via the TimelineView.Scales property) and add TimeScale elements to be available for end-users (for example, TimeScaleMonth, TimeScaleWeek and TimeScaleDay). This approach can be helpful if you wish to hide specific time intervals in the Timeline View.

To change the format of a single scale header, adjust the TimeScale.DisplayFormat property of the corresponding TimeScale object.

You can also implement your own custom time scales and add them to the TimelineView.Scales collection. This example demonstrates the comparatively simple task of creating a scale with a fixed interval (four hours) by inheriting from the TimeScaleFixedInterval class. For more complex tasks, use the TimeScale descendants and override key methods.

See Also