.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.
.NET Core 3.0+

PrintingController.PrintingSettingsLoaded Event

Occurs when the PrintingController.PrintAction is executed.

Namespace: DevExpress.ExpressApp.Win.SystemModule

Assembly: DevExpress.ExpressApp.Win.v19.2.dll

Declaration

public event EventHandler<PrintableComponentLinkEventArgs> PrintingSettingsLoaded
Public Event PrintingSettingsLoaded As EventHandler(Of PrintableComponentLinkEventArgs)

Event Data

The PrintingSettingsLoaded event handler receives an argument of the DevExpress.ExpressApp.Win.SystemModule.PrintableComponentLinkEventArgs type.

Remarks

The PrintingSettingsLoaded event is raised as the result of invoking the PrintingController.LoadPrintingSettings method. You can handle this event in a custom View Controller to customize the PrintableComponentLink, which represents a printing link to the printable control. In the handler, you can access the PrintableComponentLink object in the following manner:

using DevExpress.ExpressApp.Win.SystemModule;
// ...
public class ConfigurePrintingSettingsViewController : ViewController {
    private PrintingController printingService;
    protected override void OnActivated() {
        base.OnActivated();
        printingService = Frame.GetController<PrintingController>();
            if (printingService != null)
                printingService.PrintingSettingsLoaded += printingService_PrintingSettingsLoaded;
    }
    private void printingService_PrintingSettingsLoaded(
        object sender, PrintableComponentLinkEventArgs e) {
        e.PrintableComponentLink.PaperKind = System.Drawing.Printing.PaperKind.A4;
        e.PrintableComponentLink.Landscape = true;
    }
    protected override void OnDeactivated() {
        if (printingService != null)
            printingService.PrintingSettingsLoaded -= printingService_PrintingSettingsLoaded;
        base.OnDeactivating();
    }
}

The PrintableComponentLink object provides access to the PrintingSystem object using the PrintingSystem property. Refer to the How to: Customize Export Options of the Printing System, to see an example on how to access the Printing System in the PrintingSettingsLoaded event handler.

NOTE

The PrintingSettingsLoaded event is not raised when GridControl is used with a CollectionSource object in Server mode (see CollectionSourceBase.DataAccessMode), or when the PrintingController.CustomForceGridControlMethods event is handled and its Force parameter is set to true. In this case, you can customize the grid print preview options using the GridOptionsPrint object.

See Also