Skip to main content

ExpressionBindingDescription Class

Stores information about expression bindings for properties displayed in the End-User Report Designer Properties window.

Namespace: DevExpress.XtraReports.Expressions

Assembly: DevExpress.XtraReports.v24.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public class ExpressionBindingDescription

Remarks

When you implement custom controls, you can define bindable properties — the properties to which users can bind data. To show these properties in the Properties grid as properties to which expressions are enabled, call the ExpressionBindingDescriptor.SetPropertyDescription method with the newly created ExpressionBindingDescription class instance as a parameter.

The ExpressionBindingDescription class instance contains the following information:

EventNames
A collection of events in which the property is available.
Position
The node index in the tree view displayed in the Properties window‘s Expressions tab. This option has effect only for the Classic View of the Properties window.
BindableProperties
A collection of the property’s inner bindable properties.
ScopeName
The property category in the Properties window‘s Expressions tab. This option has effect only for the Classic View of the Properties window.

Tip

You can create the ExpressionBindingDescription instance and call the ExpressionBindingDescriptor.SetPropertyDescription method 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 in 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.

Inheritance

Object
ExpressionBindingDescription
See Also