Skip to main content
A newer version of this page is available. .

TableView.BestFitMaxRowCount Property

Gets or sets the number of records taken into account when calculating the optimal widths required for columns to completely display their contents. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Grid.Core, DevExpress.Wpf.Grid.Core

Declaration

public int BestFitMaxRowCount { get; set; }

Property Value

Type Description
Int32

An integer value that specifies the number of records processed by a View to apply best fit.

Remarks

Table Views provide the capability to automatically calculate and apply the optimal width required for a column to completely display its contents. To do this, use the TableView.BestFitColumn or 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.

By default, a column’s optimal width is calculated based on the text of all cells within this column. To increase the application’s performance, the number of records taken into account when calculating the optimal width can be limited by setting the TableView.BestFitMaxRowCount (ColumnBase.BestFitMaxRowCount) property. By default, this property is set to -1, to indicate that all cells are processed. If the TableView.BestFitMaxRowCount property is set to a positive value, a View processes the specified number of cells starting from the top visible cell.

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

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the BestFitMaxRowCount property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also