Back to Devexpress

XRDesignMdiController.AddCommandHandler(ICommandHandler) Method

xtrareports-devexpress-dot-xtrareports-dot-userdesigner-dot-xrdesignmdicontroller-dot-addcommandhandler-x28-devexpress-dot-xtrareports-dot-userdesigner-dot-icommandhandler-x29.md

latest3.7 KB
Original Source

XRDesignMdiController.AddCommandHandler(ICommandHandler) Method

Adds the specified command handler to the command handlers list for one or several of the report commands.

Namespace : DevExpress.XtraReports.UserDesigner

Assembly : DevExpress.XtraReports.v25.2.Extensions.dll

NuGet Package : DevExpress.Win.Reporting

Declaration

csharp
public void AddCommandHandler(
    ICommandHandler handler
)
vb
Public Sub AddCommandHandler(
    handler As ICommandHandler
)

Parameters

NameTypeDescription
handlerICommandHandler

An object which implements the ICommandHandler interface.

|

Remarks

Note

The AddCommandHandler method takes effect only in Windows Forms applications, where it must be called after the DocumentViewer.DocumentSource property has been assigned a value.

Use the AddCommandHandler method, to add custom handlers to any of the report commands listed in the ReportCommand enumeration.

To remove the current command handler from one or several report commands, use the XRDesignMdiController.RemoveCommandHandler method.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AddCommandHandler(ICommandHandler) method.

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.

reporting-winforms-designer-override-commands/CS/CustomSavingEUD/Form1.cs#L26

csharp
// Override the Open Command.
mdiController.AddCommandHandler(new OpenCommandHandler());

reporting-winforms-designer-override-commands/VB/CustomSavingEUD/Form1.vb#L32

vb
'Override the Open Command.
mdiController.AddCommandHandler(New OpenCommandHandler())

See Also

RemoveCommandHandler(ICommandHandler)

XRDesignMdiController Class

XRDesignMdiController Members

DevExpress.XtraReports.UserDesigner Namespace