Skip to main content

XRPivotGridField.BestFit() Method

Resizes the columns that correspond to the current field to the minimum width required to completely display the column’s contents.

Namespace: DevExpress.XtraReports.UI.PivotGrid

Assembly: DevExpress.XtraReports.v24.1.dll

NuGet Package: DevExpress.Reporting.Core


public void BestFit()


This method can be applied to:

  • a data field;
  • a row field;
  • a column field, provided that the following conditions are met:

    • This column field is the last among all column fields.
    • Values of this field do not have nested data field headers, which happens in either of the following instances:

      • There is only one data field in the pivot grid;
      • The data header is located either in the Column Area, before the current field header, or in the Row Area.

The method resizes the relevant columns, so that their contents are displayed completely.

See Also