Back to Devexpress

SpreadsheetCellOptions.AutoFitMergedCellRowHeight Property

officefileapi-devexpress-dot-xtraspreadsheet-dot-spreadsheetcelloptions.md

latest2.9 KB
Original Source

SpreadsheetCellOptions.AutoFitMergedCellRowHeight Property

Indicates whether the row height can be automatically adjusted for cells that are merged across a row and contain wrapped text.

Namespace : DevExpress.XtraSpreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
[DefaultValue(false)]
public bool AutoFitMergedCellRowHeight { get; set; }
vb
<DefaultValue(False)>
Public Property AutoFitMergedCellRowHeight As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true to automatically adjust the height of a row that has cells merged across; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to AutoFitMergedCellRowHeight
DocumentOptions

.Cells .AutoFitMergedCellRowHeight

|

Remarks

When you merge a cell that contains wrapped text with the other cells in a row, the height of the resulting merged cell cannot be adjusted automatically to accommodate cell content. To avoid this behavior and enable AutoFit for rows that have cells merged across, set the AutoFitMergedCellRowHeight property to true.

The following code snippet demonstrates how to enable the AutoFitMergedCellRowHeight option for the WinForms Spreadsheet control:

csharp
spreadsheetControl.Options.Cells.AutoFitMergedCellRowHeight = true;
vb
spreadsheetControl.Options.Cells.AutoFitMergedCellRowHeight = True

Use the code below to activate this option for a non-visual Workbook instance.

csharp
using(var workbook = new Workbook())
{
    workbook.Options.Cells.AutoFitMergedCellRowHeight = true;
}
vb
Using workbook As New Workbook()
    workbook.Options.Cells.AutoFitMergedCellRowHeight = True
End Using

See Also

SpreadsheetCellOptions Class

SpreadsheetCellOptions Members

DevExpress.XtraSpreadsheet Namespace