XRLabel.AutoWidth Property
Specifies whether or not the width of a label depends on its text.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v20.1.dll
NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core
Declaration
[DefaultValue(false)]
[SRCategory(ReportStringId.CatBehavior)]
public bool AutoWidth { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | false | true, to automatically adjust the width to accommodate the label text; otherwise, false. |
Remarks
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”.
The following image illustrates how the AutoWidth works when the TextAlignment property is set to “right”.
The following image illustrates how the AutoWidth works when the TextAlignment property is set to “center”.