The requested page is not available for the requested platform. You are viewing the content for Default platform.

XRCheckBox Class

Displays True/False or Checked/Unchecked/Indeterminate values in a report

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

[ToolboxTabName("DX.18.2: Report Controls")]
[XRDesigner("DevExpress.XtraReports.Design.XRCheckBoxDesigner,DevExpress.XtraReports.v18.2.Extensions, Version=18.2.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")]
[DefaultBindableProperty("CheckState")]
[ToolboxBitmap(typeof(XRCheckBox))]
[XRToolboxSubcategory(0, 1)]
[ToolboxBitmap24("DevExpress.XtraReports.Images.Toolbox24x24.XRCheckBox.png,DevExpress.XtraReports.v18.2.Extensions, Version=18.2.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")]
[ToolboxBitmap32("DevExpress.XtraReports.Images.Toolbox32x32.XRCheckBox.png,DevExpress.XtraReports.v18.2.Extensions, Version=18.2.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")]
[ToolboxSvgImage("DevExpress.XtraReports.SvgImages.Controls.XRCheckBox.svg,DevExpress.XtraReports.v18.2.Extensions, Version=18.2.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")]
public class XRCheckBox :
    XRFieldEmbeddableControl,
    IEditOptionsContainer
<ToolboxTabName("DX.18.2: Report Controls")>
<XRDesigner("DevExpress.XtraReports.Design.XRCheckBoxDesigner,DevExpress.XtraReports.v18.2.Extensions, Version=18.2.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")>
<DefaultBindableProperty("CheckState")>
<ToolboxBitmap(GetType(XRCheckBox))>
<XRToolboxSubcategory(0, 1)>
<ToolboxBitmap24("DevExpress.XtraReports.Images.Toolbox24x24.XRCheckBox.png,DevExpress.XtraReports.v18.2.Extensions, Version=18.2.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")>
<ToolboxBitmap32("DevExpress.XtraReports.Images.Toolbox32x32.XRCheckBox.png,DevExpress.XtraReports.v18.2.Extensions, Version=18.2.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")>
<ToolboxSvgImage("DevExpress.XtraReports.SvgImages.Controls.XRCheckBox.svg,DevExpress.XtraReports.v18.2.Extensions, Version=18.2.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")>
Public Class XRCheckBox
    Inherits XRFieldEmbeddableControl
    Implements IEditOptionsContainer

Remarks

You can add this control by dragging the XRCheckBox item from the DX:18.2: Report Controls Toolbox tab onto the report.

report-control-check-box

Use one of the following properties to set the checkbox's state:

  • XRCheckBox.Checked - indicates whether the check box is selected (displays a check mark) or not (is empty).
  • XRCheckBox.CheckState - specifies one of the following checkbox states:

    snap-check-box-unchecked Unchecked

    snap-check-box-checked Checked

    snap-check-box-indetermined Indeterminate

The XRControl.Text property specifies the checkbox's caption. You can double-click the checkbox to invoke its in-place editor and type the desired text.

RD_Controls_Label_1

You can bind the XRCheckBox.CheckState property to a data field obtained from the data source. Click the control's smart tag, expand the Expression drop-down list for the CheckState property and select the required data field.

check-box-checkstate-expression-binding

See the Check Box topic for more information.

Examples

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;
}

Implements

DevExpress.XtraReports.Serialization.IXRSerializable
DevExpress.Utils.Serializing.Helpers.IXtraSupportDeserializeCollectionItem
DevExpress.Utils.Serializing.IXtraSerializable
DevExpress.XtraReports.Native.IDisplayNamePropertyContainer
DevExpress.XtraReports.Native.IEditOptionsContainer
See Also