xtrareports-devexpress-dot-xtrareports-dot-expressions-dec1478a.md
Allows you to enable expressions and hide properties in the End-User Report Designer Properties panel.
Namespace : DevExpress.XtraReports.Expressions
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
public static class ExpressionBindingDescriptor
Public Module ExpressionBindingDescriptor
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:
You can also use this technique to enable expressions for properties of built-in reporting controls.
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();
}
Imports DevExpress.XtraReports.Expressions
Imports DevExpress.XtraReports.UI
Imports System.Windows.Forms
Imports System
' ...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
' Create a Design Tool with an assigned report instance.
Dim designTool As New ReportDesignTool(New XtraReport1())
' Specify settings for a new "Angle" property.
Dim events_Renamed() As String = { "BeforePrint" }
Dim position As Integer = 0
Dim innerProperties(-1) As String
Dim category As String = "New Category"
' Create a new description.
Dim description As New ExpressionBindingDescription(events_Renamed, position, innerProperties, category)
' Set the description for the XRLabel's "Angle" property.
ExpressionBindingDescriptor.SetPropertyDescription(GetType(XRLabel), "Angle", description)
' Hide the "Tag" property from the "Properties" panel.
ExpressionBindingDescriptor.HidePropertyDescriptions(GetType(XRLabel), "Tag")
designTool.ShowDesigner()
End Sub
Office-Inspired View of the Properties window.
Classic View of the Properties window.
Object ExpressionBindingDescriptor
See Also