BlazorExportController.CustomizeGridExport Event
Fires before the export operation.
Namespace: DevExpress.ExpressApp.Blazor.SystemModule
Assembly: DevExpress.ExpressApp.Blazor.v25.1.dll
NuGet Package: DevExpress.ExpressApp.Blazor
Declaration
Event Data
The CustomizeGridExport event's data class is GridExportEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
DocumentOptions | Stores PDF export options. |
ExportTarget | Inherited from GridExportEventArgsBase. |
Handled | Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. Inherited from HandledEventArgs. |
Options | Stores CSV, XLS, and XLSX export options. Inherited from GridExportEventArgsBase<T>. |
Remarks
The CustomizeGridExport
event occurs before export. The handler’s Options parameter allows you to customize export options. To obtain the target format of the resulting file, use the handler’s ExportTarget parameter.
The following code snippet implements a Controller in an ASP.NET Core Blazor module. The controller accesses export options (GridXlExportOptions
):
using DevExpress.Blazor;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Blazor.SystemModule;
using DevExpress.ExpressApp.SystemModule;
// ...
public partial class CustomizeExportControllerBlazor : ViewController {
public CustomizeExportControllerBlazor() {
InitializeComponent();
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.Options is GridXlExportOptions options) {
options.ExportSelectedRowsOnly = true;
}
}
protected override void OnDeactivated() {
blazorExportController.CustomizeGridExport -= blazorExportController_CustomizeGridExport;
base.OnDeactivated();
}
}