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

PivotGridField.BestFit() Method

In This Article

Resizes the field’s column(s) to fit the longest text currently displayed in the column.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v24.2.dll

NuGet Package: DevExpress.Win.PivotGrid

#Declaration

public void BestFit()

#Remarks

The BestFit method resizes the columns related to the current field to display the entire field contents. Call the method after the Pivot Grid loads the data and calculates its layout.

Important

Do not call the BestFit method enclosed in an PivotGridControl.BeginUpdate - PivotGridControl.EndUpdate pair. An exception occurs: “This operation cannot be executed when pivot grid updates are blocked. The control’s visual presentation is created after the EndUpdate method is called, so that you cannot perform actions that affect it within the BeginUpdate and EndUpdate method calls.”

The method applies to the following fields:

See Also