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.v19.1.dll
NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Core
Declaration
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.