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

GanttView.Zoom Property

Gets or sets the current zoom. This is a dependency property.

Namespace: DevExpress.Xpf.Gantt

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Gantt, DevExpress.Wpf.Gantt

Declaration

public TimeSpan Zoom { get; set; }

Property Value

Type Description
TimeSpan

A time span that occupies 1 device-independent pixel in the timescale.

Remarks

The Zoom property returns a System.TimeSpan value that occupies a single device-independent pixel (DIP) rendered on screen.

The image below illustrates the GanttControl with the Zoom property set to 1 minute. Each hour in the time scale occupies 60 device-independent pixels (1 DIP for each minute) and each 30 minute span occupies 30 DIPs.

The code sample below demonstrates how to set the Zoom property to 1 minute.

<dxgn:GanttControl ItemsSource="{Binding Tasks}">
    <dxgn:GanttControl.View>
        <dxgn:GanttView ... Zoom="00:01:00">
        </dxgn:GanttView>
    </dxgn:GanttControl.View>
</dxgn:GanttControl>

Use the ZoomIn and the ZoomOut methods to zoom the Gantt area in and out. These methods change the Zoom property value respecting the available zoom range, specified by the ZoomRange property.

Tip

You can set any valid Zoom property value outside the ZoomRange.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Zoom 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