Skip to main content

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.v23.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public static class ExpressionBindingDescriptor

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:

  • EventNames

    A collection of events in which the property is available.

  • Position

    The property position 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.

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.

Office-Inspired View

Classic View of the Properties window.

Classic View

Inheritance

Object
ExpressionBindingDescriptor
See Also