Skip to main content

XtraReport.DesignerLoaded Event

Occurs after the End-User Designer for WinForms loads the current report.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v22.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public event DesignerLoadedEventHandler DesignerLoaded

Event Data

The DesignerLoaded event's data class is DesignerLoadedEventArgs. 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

The DesignerLoaded event occurs when the End-User Designer for Winforms loads the current report, completes all initialization tasks, and is ready for display. You can handle the DesignerLoaded event to customize the Designer dashboard or perform other tasks.

The event handler is attached to a specific report instance. If the end user loads another report into the same End-User Designer instance, the previous event handler is lost. You must handle the DesignerLoaded event of that particular report to perform the same actions that were applied when the first report was loaded. If you are using an MDI End-User Designer, handle the [XRDesignMdiController.DesignPanelLoaded](xref:DevExpress.XtraReports.UserDesigner.XRDesignMdiController. DesignPanelLoaded) event instead of the DesignerLoaded event, because the XRDesignMdiController.DesignPanelLoaded event occurs for any report in the MDI End-User Designer.

Note

The DesignerLoaded event is specific to Reporting for Winforms.

Example

This example adds a custom control to the toolbox in the End-User Report Designer for Winforms. The XtraReport.DesignerLoaded event is used to access 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 Use Custom 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) {
    XtraReport1 report = new XtraReport1();
    ReportDesignTool designTool = new ReportDesignTool(report);
    report.DesignerLoaded += report_DesignerLoaded;
    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