ExpressionBindingDescriptor Class
Allows you to enable expressions and hide properties in the End-User Report Designer Properties panel.
Namespace: DevExpress.XtraReports.Expressions
Assembly: DevExpress.XtraReports.v24.2.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
Remarks
When you implement custom controls, you can specify the properties to which users should bind data. To enable expressions for these properties in the Properties grid, call the ExpressionBindingDescriptor.SetPropertyDescription method. Pass the type of your control, the bindable property, and expression bindings description. Use the ExpressionBindingDescription class to specify the following information for this description:
-
A collection of events in which the property is available.
-
The property position in the Properties window‘s Expressions tab. This option has effect only for the Classic View of the Properties window.
-
A collection of the property’s inner bindable properties.
-
The property category in the Properties window‘s Expressions tab. This option has effect only for the Classic View of the Properties window.
You can also use this technique to enable expressions for properties of built-in reporting controls.
Example: Enable and Disable Expressions for XRLabel’s properties
The following code sample demonstrates how to enable expressions for the XRLabel‘s Angle property and hide the XRLabel‘s Tag property from the Properties panel.
using DevExpress.XtraReports.Expressions;
using DevExpress.XtraReports.UI;
using System.Windows.Forms;
using System;
// ...
private void Form1_Load(object sender, EventArgs e) {
// Create a Design Tool with an assigned report instance.
ReportDesignTool designTool = new ReportDesignTool(new XtraReport1());
// Specify settings for a new "Angle" property.
string[] events = new string[] { "BeforePrint" };
int position = 0;
string[] innerProperties = new string[0];
string category = "New Category";
// Create a new description.
ExpressionBindingDescription description = new ExpressionBindingDescription(
events, position, innerProperties, category
);
// Set the description for the XRLabel's "Angle" property.
ExpressionBindingDescriptor.SetPropertyDescription(typeof(XRLabel), "Angle", description);
// Hide the "Tag" property from the "Properties" panel.
ExpressionBindingDescriptor.HidePropertyDescriptions(typeof(XRLabel), "Tag");
designTool.ShowDesigner();
}
Office-Inspired View of the Properties window.
Classic View of the Properties window.