DataGridView.CalcBestFitAsync(GridColumn, Boolean) Method
Calculates the best-fit width for all columns or for the specified column asynchronously. The CalcBestFitAsync
method returns Task that completes when the column width calculates.
Namespace: DevExpress.Maui.DataGrid
Assembly: DevExpress.Maui.DataGrid.dll
NuGet Package: DevExpress.Maui.DataGrid
Declaration
public Task CalcBestFitAsync(
GridColumn column = null,
bool waitImageLoading = true
)
Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
column | GridColumn | null | The target column or all columns (if |
waitImageLoading | Boolean | True |
|
Returns
Type | Description |
---|---|
Task | An operation that executes asynchronously and is completed together with the column width calculation process. |
Remarks
Set the AutoBestFitColumns property to true
to calculate the column width based on the specified BestFitMode.
The DataGridView recalculates the column width automatically only in response to changes in the bound data source. You can call the CalcBestFitAsync()
method to force column width recalculation.
For more information, refer to the following section: Data Grid Best-Fit Width.