Back to Devexpress

GridExportEventArgs.DocumentOptions Property

expressappframework-devexpress-dot-expressapp-dot-blazor-dot-systemmodule-dot-gridexporteventargs.md

latest3.1 KB
Original Source

GridExportEventArgs.DocumentOptions Property

Stores PDF export options.

Namespace : DevExpress.ExpressApp.Blazor.SystemModule

Assembly : DevExpress.ExpressApp.Blazor.v25.2.dll

NuGet Package : DevExpress.ExpressApp.Blazor

Declaration

csharp
public GridDocumentExportOptions DocumentOptions { get; }
vb
Public ReadOnly Property DocumentOptions As GridDocumentExportOptions

Property Value

TypeDescription
GridDocumentExportOptions

An instance of the GridDocumentExportOptions class.

|

Remarks

When you export data to PDF, subscribe to the BlazorExportController.CustomizeGridExport event and use the event handler’s DocumentOptions parameter to access GridDocumentExportOptions.

The following code snippet specifies PDF export options (limits export to selected rows only):

csharp
using DevExpress.Blazor;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Blazor.SystemModule;
using DevExpress.ExpressApp.SystemModule;
// ...
public partial class CustomizeExportControllerBlazor : ViewController {
    public CustomizeExportControllerBlazor() {
        TargetViewType = ViewType.ListView;
    }
    private BlazorExportController blazorExportController;
    protected override void OnActivated() {
        base.OnActivated();
        blazorExportController = Frame.GetController<BlazorExportController>();
        // Subscribe to CustomizeGridExport event
        blazorExportController.CustomizeGridExport += blazorExportController_CustomizeGridExport;
    }
    void blazorExportController_CustomizeGridExport(object sender, GridExportEventArgs e) {
        // Export only selected rows
        if(e.DocumentOptions != null) {
            e.DocumentOptions.ExportSelectedRowsOnly = true;
        }
    }
    protected override void OnDeactivated() {
        blazorExportController.CustomizeGridExport -= blazorExportController_CustomizeGridExport;
        base.OnDeactivated();
    }
}

See Also

GridExportEventArgs Class

GridExportEventArgs Members

DevExpress.ExpressApp.Blazor.SystemModule Namespace