Skip to main content
A newer version of this page is available. .

XRCheckBox.TextFormatString Property

Specifies the output format for the control’s bound value (provided by the applied expression, data binding or summary).

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

[Browsable(true)]
public override string TextFormatString { get; set; }

Property Value

Type Description
String

A string containing the output format for the check box’s text.

Remarks

When the UserDesignerOptions.DataBindingMode is set to DataBindingMode.Expressions or DataBindingMode.ExpressionsAdvanced, you can format the check box’s XRControl.Text property value using the TextFormatString property.

The following code snippet demonstrates how to specify expressions for the XRCheckBox.CheckState and XRControl.Text properties and format the output text. This code assumes that a report is bound to a data source containing the ProductID and Discontinued fields.

using DevExpress.XtraReports.UI;

public XtraReport1() {
    // ...
     xrCheckBox1.ExpressionBindings.AddRange(new ExpressionBinding[] {
         new ExpressionBinding("BeforePrint", "CheckState", "[Discontinued]"),
         new ExpressionBinding("BeforePrint", "Text", "[ProductID]")});
     xrCheckBox1.TextFormatString = "Product ID: {0}";
}

See the Formatting Data document to learn about applying formats at design time.

See Also