Skip to main content

PivotGridControl.BestFit(PivotGridField) Method

Resizes the columns and rows which correspond to the specified fields, to the minimum width and height required to completely display their contents.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v21.2.dll


public void BestFit(
    PivotGridField field


Name Type Description
field PivotGridField

A PivotGridField object that represents the pivot grid field.


When the PivotGridControl.RowTotalsLocation property is set to FieldRowTotalsLocation.Tree, calling the BestFit method for row fields has no effect. In this instance, to apply best fit to row fields, use another overload of this method, which takes the area parameter, and pass the FieldArea.RowArea value as this parameter.


The Best Fit is available only after the Pivot Grid Control has been loaded in the visual tree.

To learn more, see Best Fit.

See Also