Skip to main content

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BestFitMode Enum

Lists the values used to specify the way the column width should be calculated.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v24.1.dll

NuGet Package: DevExpress.Wpf.Core

#Declaration

public enum BestFitMode

#Members

Name Description
Default

If this mode is assigned to the ColumnBase.BestFitMode of a grid column, this means that it obtains its value from the TableView.BestFitMode property of the owner view.

AllRows

The column width is calculated based on text of all cells within this column.

VisibleRows

The column width is calculated based on the values in the currently visible cells.

DistinctValues

The column width is calculated based on all distinct values in the underlying datasource.

Smart

In this mode, the column width is calculated as BestFitMode.AllRows if the total count of rows is less than 3,000, and as BestFitMode.DistinctValues if the total count of rows is greater than or equal to 3,000. Also, if the Smart mode is enabled, the TableView.CustomBestFit is raised, thus allowing you to manually calculate the column width.

#Remarks

Values listed by the BestFitMode enumeration are used to set the TableView.BestFitMode and ColumnBase.BestFitMode properties.

See Also