Skip to main content
A newer version of this page is available. .

XRDesignMdiController.DesignPanelLoaded Event

Occurs when an XRDesignPanel object has been loaded.

Namespace: DevExpress.XtraReports.UserDesigner

Assembly: DevExpress.XtraReports.v19.1.Extensions.dll

NuGet Package: DevExpress.Win.Reporting

Declaration

public event DesignerLoadedEventHandler DesignPanelLoaded

Event Data

The DesignPanelLoaded 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

Within a multi-document interface, the DesignPanelLoaded event provides the functionality similar to that of the XtraReport.DesignerLoaded event of a single-document Report Designer version, but the changes made in the DesignPanelLoaded event handler will apply to all the reports opened within the End-User Report Designer form.

For example, the DesignPanelLoaded event can be used for adding custom controls to an MDI Designer’s toolbox.

Example

This example illustrates how to add a custom control to an End-User Report Designer’s toolbox by handling the XRDesignMdiController.DesignPanelLoaded 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 Design Tool with an assigned report instance.
    ReportDesignTool designTool = new ReportDesignTool(new XtraReport1());

    // Access the standard or ribbon-based Designer form.
    // IDesignForm designForm = designTool.DesignForm;
    IDesignForm designForm = designTool.DesignRibbonForm;

    // Handle the Design Panel's Loaded event.
    designForm.DesignMdiController.DesignPanelLoaded += DesignMdiController_DesignPanelLoaded;

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

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

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

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

The following code snippets (auto-collected from DevExpress Examples) contain references to the DesignPanelLoaded event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also