Skip to main content
A newer version of this page is available.
All docs
V18.2
Row

RangeExtensions.AutoFitColumns(Range) Method

Adjusts the width of columns that comprise the cell range to accommodate the cell content of this range.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v18.2.Core.dll

Declaration

public static void AutoFitColumns(
    this Range range
)

Parameters

Name Type Description
range Range

A Range object specifying a cell range that belongs to columns to be automatically resized.

Remarks

The AutoFitColumns method is an extension method of the Range object that is called by using the instance method syntax.

The ColumnCollection.AutoFit and Column.AutoFit methods automatically adjust the width of columns to fit the cell content of entire columns.

To set column width values in required units of measurement, use the Column.Width or Range.ColumnWidth property (see the How to: Specify Row Height or Column Width example).

See Also