ASPxClientReportDesigner.ComponentAdded Event

Occurs after a component has been added to the report currently being edited in the Web Report Designer.

Namespace: DevExpress.XtraReports.Web.Scripts

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

Declaration

public event ASPxClientReportDesignerComponentAddedEventHandler ComponentAdded
Public Event ComponentAdded As ASPxClientReportDesignerComponentAddedEventHandler

The event handler receives an argument of the ASPxClientReportDesignerComponentAddedEventHandler type.

The ComponentAdded event raises when an end-user drops a control from the Toolbox onto the report currently being edited in the Report Designer.

The code sample below demonstrates how to use this event to change the text and text alignment properties of label controls added to the report.

<script type="text/javascript" id="script">
    function componentAdded(s, e) {
        var model = e.Model;
        if (model.controlType === "XRLabel") {
            model.text("Label");
            model.textAlignment("MiddleCenter")
        }
    }
</script>

<dx:ASPxReportDesigner ID="ASPxReportDesigner1" runat="server">
    <ClientSideEvents ComponentAdded="componentAdded"/>
</dx:ASPxReportDesigner>

See Also