XRCheckBox.Checked Property
Gets or sets a value indicating whether the check box is checked.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v17.2.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
[DefaultValue(false)]
[SRCategory(ReportStringId.CatData)]
public bool Checked { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | **false** | true if the check box is checked; otherwise, false. |
Remarks
Use the Checked property to specify whether a XRCheckBox is checked (displays a check mark) or not (is empty).
Note
If the Checked property is set to true and the XRCheckBox.CheckState property is set to the Indeterminate value, the check box displays a shaded check mark.
Example
The following code creates an XRCheckBox object, and sets some of its properties.
using DevExpress.XtraReports.UI;
// ...
public XRCheckBox CreateXRCheckBox()
{
// Create an XRCheckBox object.
XRCheckBox xrCheckBox1 = new XRCheckBox();
// Bind the CheckState property to the UnitsInStock data field.
// Change the control's text depending on the UnitsInStock data field value.
xrCheckBox1.ExpressionBindings.AddRange(new ExpressionBinding[] {
new ExpressionBinding("BeforePrint", "CheckState", "Iif([UnitsInStock]>=1,\'Checked\', \'Unchecked\')"),
new ExpressionBinding("BeforePrint", "Text",
"Iif([UnitsInStock]>0,\'Units in Stock: \' + [UnitsInStock], \'None\')")});
// Set the control's size.
xrCheckBox1.SizeF = new SizeF(150F, 20F);
return xrCheckBox1;
}
See Also