XRControl.Visible Property
Gets or sets a value that specifies whether the report control is displayed in the document.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v24.2.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
[DefaultValue(true)]
[SRCategory(ReportStringId.CatBehavior)]
[XRLocalizable(true)]
public virtual bool Visible { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | true | true if the control is shown; otherwise, false. |
Remarks
If the Visible
property is set to false
, a blank space of the control’s size appears in the document, regardless of the value of the CanShrink property. An exception to this rule is the XRSubreport control, because it is hidden in the document if its CanShrink property is set to true
.
To maintain the position and visibility of report elements in a document, it is recommended that you create reports programmatically. Review the following help topic for more information: Create a Report in Code.
If you set a control’s Visible
property to false
, the control is displayed in Report Designer with a striped background.
To hide a control without leaving blank space in the report, set the properties as follows:
- CanShrink
True
- Text
Empty string (‘’). To hide a control based on a condition, specify the following expression as the Text expression binding that conditionally sets its value to an empty string:
Iif(YOUR_CONDITION, '', TEXT OR [YOUR_DATA_FIELD])
Visible
True
(default value)
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Visible property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.