Skip to main content

XlCellAlignment.ShrinkToFit Property

Gets or sets a value indicating whether the font size of the cell text should be automatically adjusted to fit the cell width.

Namespace: DevExpress.Export.Xl

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

NuGet Package: DevExpress.Printing.Core

Declaration

public bool ShrinkToFit { get; set; }

Property Value

Type Description
Boolean

true, if the cell text size should be shrunk; otherwise, false.

Remarks

If the ShrinkToFit property is true, the size of the text font in a cell is automatically reduced until the entire cell content can be displayed. Note that the actual size of the font applied to a cell (XlFontBase.Size) is not changed. If a cell contains multiple lines of text (the XlCellAlignment.WrapText property is true), the ShrinkToFit property is not applicable.

To set other alignment characteristics for an individual cell (e.g., horizontal and vertical alignment, indent, text rotation and wrapping), use the corresponding properties of the XlCellAlignment object.

To apply the alignment settings to a cell, pass the specified XlCellAlignment object to the IXlCell.ApplyFormatting method as a parameter, or assign it to the IXlCell.Formatting property.

For more information on how to align data contained in a cell, refer to the How to: Align Cell Content topic.

See Also