Back to Devexpress

ColumnBase.BestFitMode Property

wpf-devexpress-dot-xpf-dot-grid-dot-columnbase-a3436ce7.md

latest2.7 KB
Original Source

ColumnBase.BestFitMode Property

Gets or sets how to calculate the optimal width required for this column to completely display its contents.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public BestFitMode BestFitMode { get; set; }
vb
Public Property BestFitMode As BestFitMode

Property Value

TypeDescription
BestFitMode

A mode that specifies how to calculate the optimal width required for this column to completely display its contents.

|

Available values:

NameDescription
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

The TableView.BestFitMode property specifies the default behavior of all columns displayed within a View. The BestFitMode property allows you to override this behavior for individual columns.

See Also

BestFitMode

BestFitArea

Move and Resize Columns

ColumnBase Class

ColumnBase Members

DevExpress.Xpf.Grid Namespace