Skip to main content
Row

PivotBehaviorOptions.AutoFitColumns Property

Gets or sets a value indicating whether column widths should be automatically resized when the pivot table is recalculated or refreshed.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

bool AutoFitColumns { get; set; }

Property Value

Type Description
Boolean

true, to automatically adjust column widths each time the pivot table is updated; otherwise, false.

The default value is true.

Property Paths

You can access this nested property as listed below:

Object Type Path to AutoFitColumns
PivotTable
.Behavior .AutoFitColumns

Remarks

By default, when you change your PivotTable report (add, move or remove fields, change the report layout, apply filters etc.) or perform a refresh operation, column widths in the pivot table are automatically resized to fit the cell content. To preserve the column widths so that they don’t change when the pivot table is recalculated or refreshed, set the AutoFitColumns property to false.

The following code snippets (auto-collected from DevExpress Examples) contain references to the AutoFitColumns property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also