The requested page is not available for the requested platform. You are viewing the content for Default platform.

XtraReport.DesignerLoaded Event

Occurs after the End-User Designer has been loaded for the current report instance.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.1.dll

Declaration

public event DesignerLoadedEventHandler DesignerLoaded
Public Event DesignerLoaded As DesignerLoadedEventHandler

Event Data

The DesignerLoaded event handler receives an argument of the DesignerLoadedEventArgs type. The following properties provide information specific to this event.

Property Description
DesignerHost Gets the designer host which provides all the services that are available for editing a report in its End-User Designer.

Remarks

Use the DesignerLoaded event to perform particular actions (for instance, customize the designer's toolbox), after all initialization has been performed (all the hosts and services required by the report's End-User Designer have been initialized) and the designer is ready to be shown.

Note

If an end-user then tries to load another report into the same End-User Designer instance, you need to handle the DesignerLoaded event of that report, to perform the same actions with the End-User Designer as were applied when the first report was loaded. And, when using an MDI End-User Designer, use the XRDesignMdiController.DesignPanelLoaded event instead. Because, within a multi-document interface, actions performed in the DesignerLoaded event will apply only to a specific report instance.

Examples

This example illustrates how to add a custom control to an End-User Report Designer's toolbox by handling the XtraReport.DesignerLoaded event and accessing the toolbox service.

Tip

This code adds the XRZipCode control to the toolbox. It is hidden by default because most countries do not use it.

See Using Custom and Third-Party Controls to learn how to create custom report controls and add them to a Report Designer's toolbox.

using DevExpress.XtraReports.UI;
using DevExpress.XtraReports.UserDesigner;
using System.Drawing.Design;
// ...

private void button1_Click(object sender, System.EventArgs e) {
    // Create a report instance.
    XtraReport1 report = new XtraReport1();

    // Create a Design Tool and assign the report to it.
    ReportDesignTool designTool = new ReportDesignTool(report);

    // Handle the DesignerLoaded event of the report.
    report.DesignerLoaded += report_DesignerLoaded;

    // Load a Report Designer in a dialog window.
    // designTool.ShowDesignerDialog();
    designTool.ShowRibbonDesignerDialog();
}

void report_DesignerLoaded(object sender, DesignerLoadedEventArgs e) {
    // Access the Toolbox service.
    IToolboxService toolboxService = 
        (IToolboxService)e.DesignerHost.GetService(typeof(IToolboxService));

    // Add a custom control to the default category.
    toolboxService.AddToolboxItem(new ToolboxItem(typeof(XRZipCode)));

    // Add a custom control to a new category.
    // toolboxService.AddToolboxItem(new ToolboxItem(typeof(XRZipCode)), "New Category");
}
See Also