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

TreeListView.AutoWidth Property

Gets or sets whether column widths are automatically changed so that the total columns’ width matches the grid’s width. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Grid.Core, DevExpress.Wpf.Grid.Core

Declaration

public bool AutoWidth { get; set; }

Property Value

Type Description
Boolean

true to enable the column auto width feature; otherwise, false. The default is false.

Remarks

Column widths can be changed automatically, so that the total columns’ width matches the grid’s width. In this instance, changing the width of one column automatically changes the widths of other columns. This behavior is controlled by the view’s AutoWidth property. To obtain the actual width of columns, use their BaseColumn.ActualWidth property.

If the automatic column width calculation is disabled, a column’s width is specified by its BaseColumn.Width property. If the total columns’ width exceeds the grid’s width, a horizontal scrollbar is displayed, allowing an end-user to scroll grid columns. If you want a column (or columns) to always be displayed onscreen, regardless of scrolling, set its BaseColumn.Fixed property.

To learn more, see Columns Layout and Width and Fixed Columns and Bands.

The following code snippets (auto-collected from DevExpress Examples) contain references to the AutoWidth 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