Click or drag to resize
ExcelColumnAutoFit Method (Double, ExcelRow, ExcelRow)
Automatically fits column width by checking only the cells in the column that are specified by row range.

Namespace: GemBox.Spreadsheet
Assembly: GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1000
Syntax
public void AutoFit(
	double scaling,
	ExcelRow firstRow,
	ExcelRow lastRow
)

Parameters

scaling
Type: SystemDouble
Scaling factor.
firstRow
Type: GemBox.SpreadsheetExcelRow
First row.
lastRow
Type: GemBox.SpreadsheetExcelRow
Last row.
Remarks

Auto-fit column width is a MS Excel feature and not a file format feature. Autofit method uses methods from System.Drawing to determine the real data width.

Scaling factor is used to adjust the width of the column. Resulting column width is equal to CalculatedWidth * scaling. Default scaling is 1.

See Also