A newer version of this page is available. Switch to the current version.

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.v19.1.dll

Declaration

public bool AutoWidth { get; set; }

Property Value

Type Default Description
Boolean

false

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

Remarks

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" 
                 EnableSmartColumnsGeneration="True" 
                 ItemsSource="{Binding Customers}">
    <dxg:GridControl.View>
        <dxg:TableView AutoWidth="True"/>
    </dxg:GridControl.View>
</dxg:GridControl> 

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