The requested page is not available for the requested platform. You are viewing the content for Default platform.
All docs
V18.2
19.1 (preview)
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
18.1
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

ASPxDesignerControlsFactory.setExpressionBinding(String, String, String[], String, String[]) Method

Adds a new specified property for the specified control to the End-User Report Designer's Expressions tab.

Namespace: DevExpress.XtraReports.Web.Scripts

Assembly: DevExpress.XtraReports.v18.2.Web.Scripts.dll

Declaration

public void setExpressionBinding(
    string controlType,
    string propertyName,
    string[] events,
    string group,
    string[] objectProperties
)
Public Sub setExpressionBinding(
    controlType As String,
    propertyName As String,
    events As String(),
    group As String,
    objectProperties As String()
)

Parameters

Name Type Description
controlType String

A string that specifies the control type for which to add the property.

propertyName String

A string that specifies the property name to add.

events String[]

An array of strings that specify events in which the property should be available.

group String

A string that specifies the category in which the property should be displayed.

objectProperties String[]

An array of strings that specify the property's inner properties.

Remarks

Handle the CustomizeToolbox event and use the setExpressionBinding method to add new properties to the End-User Report Designer's Expressions tab.

The following code snippet demonstrates how to create a new category for the Label control and add the TextFormatString property:

<script type="text/javascript">
    function customizeToolbox(s, e) {
        e.ControlsFactory.setExpressionBinding("XRLabel", "TextFormatString", ["BeforePrint"], "My category"); 
    }
</script>

<dx:ASPxReportDesigner ID="ASPxReportDesigner1" ClientInstanceName="reportDesigner" runat="server">
    <ClientSideEvents CustomizeToolbox="customizeToolbox" />
</dx:ASPxReportDesigner>

To serialize the added property, you should also register it on the server side at the application's startup:

using DevExpress.XtraReports.Expressions;
using DevExpress.XtraReports.UI;

void Application_Start(object sender, EventArgs e) {
  // ...
    ExpressionBindingDescription description = new ExpressionBindingDescription(
        new string[] { "BeforePrint" }, 0, new string[0], "My category");

    ExpressionBindingDescriptor.SetPropertyDescription(typeof(XRLabel), "TextFormatString", description);
    // ...
}

The following image shows the result.

See Also