XRLabel.AutoWidth Property

Specifies whether or not the width of a label depends on its text.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

[Favorite(true)]
[SRCategory(ReportStringId.CatBehavior)]
public bool AutoWidth { get; set; }
<Favorite(True)>
<SRCategory(ReportStringId.CatBehavior)>
Public Property AutoWidth As Boolean

Property Value

Type Description
Boolean

true, to automatically adjust the width to accommodate the label text; otherwise, false.

Use the AutoWidth property to always print an XRLabel's text in full, without limiting it by the control's dimensions. This is often required if a label's text is supplied from a data source and is not immediately available at Visual Studio design time (e.g., if a label has been assigned a summary function).

When using this feature, consider the following.

  • The result of using this option depends on the XRControl.WordWrap property value.

    • if the WordWrap property is enabled, a label's width can be only decreased;
    • if the WordWrap property is disabled, a label's width can either be increased or decreased to best fit a label's contents.
  • This option has no effect on the width or position of other report controls.
  • This option depends on the current horizontal alignment setting of a label (the XRControl.TextAlignment property value).

    The following image illustrates how the AutoWidth works when the TextAlignment property is set to "left".

    label-auto-width-left-alignment

    The following image illustrates how the AutoWidth works when the TextAlignment property is set to "right".

    label-auto-width-right-alignment

    The following image illustrates how the AutoWidth works when the TextAlignment property is set to "center".

    label-auto-width-center-new

See Also