Skip to main content

TableView.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.v22.1.dll


public bool AutoWidth { get; set; }

Property Value

Type Default Description
Boolean **false**

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


Set the AutoWidth property to true to make the GridControl change the column widths automatically. In this case, when an end user changes a column’s width, the GridControl changes the widths of other columns.

<dxg:GridControl AutoGenerateColumns="AddNew" 
                 ItemsSource="{Binding Customers}">
        <dxg:TableView AutoWidth="True"/>

Use the BaseColumn.ActualWidth property to obtain the column width.

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, specify the BaseColumn.Fixed property.

See Also