GanttView.RequestTimescaleRulers Event

Occurs when timescale rulers are visually changed and allows you to edit timescale rulers. This is a routed event.

Namespace: DevExpress.Xpf.Gantt

Assembly: DevExpress.Xpf.Gantt.v20.1.dll


public event EventHandler<RequestTimescaleRulersEventArgs> RequestTimescaleRulers
Public Event RequestTimescaleRulers As EventHandler(Of RequestTimescaleRulersEventArgs)

Event Data

The RequestTimescaleRulers event's data class is RequestTimescaleRulersEventArgs. The following properties provide information specific to this event:

Property Description
Handled Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. Inherited from RoutedEventArgs.
NonworkingDayVisibility Gets or sets the nonworking day visibility at a current zoom level.
NonworkingTimeVisibility Gets or sets the nonworking time visibility at a current zoom level.
OriginalSource Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
RoutedEvent Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
Source Gets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.
TimescaleRulers Get or sets a collection of timescale rulers displayed at the current zoom level.
Zoom Gets the current zoom.


The RequestTimescaleRulers event occurs on init, when the Gantt area is zoomed and when the TimescaleRulerCount property value is changed.

Handle the RequestTimescaleRulers event to dynamically change the following:

private void view_RequestTimescaleRulers(object sender, DevExpress.Xpf.Gantt.RequestTimescaleRulersEventArgs e) {
    // Remove a ruler from timescale
    // Add a ruler that indicates hours
    e.TimescaleRulers.Add(new DevExpress.Xpf.Gantt.TimescaleRuler(DevExpress.Xpf.Gantt.TimescaleUnit.Hour));
    // Add a ruler that indicates 30 minute ranges
    e.TimescaleRulers.Add(new DevExpress.Xpf.Gantt.TimescaleRuler(DevExpress.Xpf.Gantt.TimescaleUnit.Minute, 30));

    // Nonworking dates and nonworking time are not indicated with a specific background
    e.NonworkingDayVisibility = Visibility.Hidden;
    e.NonworkingTimeVisibility = Visibility.Hidden;
See Also