Skip to main content
Tag

ColumnBase.AllowBestFit Property

Gets or sets whether it's allowed to calculate an optimal width and apply it to the column.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v14.2.Core.dll

#Declaration

[XtraSerializableProperty]
public DefaultBoolean AllowBestFit { get; set; }

#Property Value

Type Description
DefaultBoolean

A DefaultBoolean enumeration value that specifies whether it's allowed to calculate an optimal width and apply it to the column.

#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 TableView.AllowBestFit and ColumnBase.AllowBestFit properties, respectively.

If the AllowBestFit property is set to Default, this behavior is specified by the View's TableView.AllowBestFit property.

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.

To learn more, see Best Fit in Columns Layout and Width.

See Also