XRCheckBox() Constructor
Initializes a new instance of the XRCheckBox class with the default settings.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v20.2.dll
NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core
Declaration
Example
The code sample below illustrates how to create an XRCheckBox control for a report.
using DevExpress.XtraReports.UI;
// ...
public XRCheckBox CreateXRCheckBox()
{
// Create an XRCheckBox control.
XRCheckBox xrCheckBox1 = new XRCheckBox();
xrCheckBox1.ExpressionBindings.AddRange(new ExpressionBinding[] {
// Bind the CheckState property to the UnitsInStock data field.
new ExpressionBinding("BeforePrint", "CheckState", "Iif([UnitsInStock]>=1,\'Checked\', \'Unchecked\')"),
// Change the control's text depending on the UnitsInStock data field value.
new ExpressionBinding("BeforePrint", "Text",
"Iif([UnitsInStock]>0,\'Units in Stock: \' + [UnitsInStock], \'None\')")});
// Set the control size.
xrCheckBox1.SizeF = new SizeF(150F, 20F);
return xrCheckBox1;
}
See Also