Skip to main content

DataGridView.BestFitItemsCount Property

Gets or sets the number of cells used to calculate the best-fit width for all columns. This is a bindable property.

Namespace: DevExpress.Maui.DataGrid

Assembly: DevExpress.Maui.DataGrid.dll

NuGet Package: DevExpress.Maui.DataGrid

Declaration

public int BestFitItemsCount { get; set; }

Property Value

Type Default Description
Int32 20

The number of cells used to calculate the best-fit width for all columns.

Remarks

If you set the AutoBestFitColumns property to true, the best-fit column width is calculated based on the maximum content width within specified cells. The column width calculation starts from the first top visible cell. Use the DataGridView.BestFitItemsCount property to specify the number of cells used to calculate the best-fit width for all columns.

Note that the DataGridView.BestFitItemsCount property does not affect CheckBoxColumn, ImageColumn, and TemplateColumn.

For more information, refer to the following section: Grid Column Best-Fit Width.

See Also