Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 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

GridColumn.BestFitItemsCount Property

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

Namespace: DevExpress.Maui.DataGrid

Assembly: DevExpress.Maui.DataGrid.dll

NuGet Package: DevExpress.Maui.DataGrid

#Declaration

C#
public int? BestFitItemsCount { get; set; }

#Property Value

Type Default Description
Nullable<Int32> 20

The number of cells used to calculate the best-fit width for the current column.

#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 GridColumn.BestFitItemsCount property to specify the number of cells used to calculate the best-fit width for the current column.

The GridColumn.BestFitItemsCount property also affects CheckBoxColumn, ImageColumn, and TemplateColumn. The default value for these column types is 1.

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

See Also