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
)
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.