Skip to main content

TableView.AllowBestFit Property

Gets or sets whether it is allowed to calculate the optimal widths and apply them to all columns in a View.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public bool AllowBestFit { get; set; }

Property Value

Type Description
Boolean

true to allow optimal widths to be calculated and applied to all columns displayed within a View; otherwise, false. The default is true.

Remarks

Table Views provide the capability to automatically calculate and apply the optimal width required for a column to completely display its contents. The Best Fit feature can be applied to an individual column or to all columns displayed within a Table View. To enable this feature for all visible columns or individual columns, use the AllowBestFit and BaseColumn.AllowBestFit properties, respectively.

To resize the specified column to the optimal width required to display its contents completely, use the TableView.BestFitColumn method. To resize all columns, use the TableView.BestFitColumns method. End-users can resize columns to their optimal width (if allowed) by double clicking their right border or using the column header context menu.

Refer to the Best Fit topic to learn more.

See Also