Back to Devexpress

Handle Client-Side Events in the Blazor Document Viewer

xtrareports-404134-web-reporting-blazor-reporting-web-document-viewer-customization-client-side-events.md

latest5.0 KB
Original Source

Handle Client-Side Events in the Blazor Document Viewer

  • Feb 09, 2026
  • 3 minutes to read

The Blazor Document Viewer is based on the DevExpress Web Document Viewer. The Web Document Viewer includes an advanced client-side API that allows you to customize UI elements and behavior. The DxDocumentViewerCallbacks component exposes properties that allow you to specify JavaScript functions (client-side event handlers).

Follow these steps to customize the Blazor Document Viewer using its client-side API:

  1. Place your JavaScript code in a separate file in the wwwroot folder. Use the window object to create a namespace for your code.

  2. Use the DxResourceManager.RegisterScripts() method to register the corresponding script:

  3. Specify JavaScript function names as event handlers for the DxDocumentViewerCallbacks component:

Document Viewer Client-Side events allow you to perform the following actions:

Customize Document Viewer Elements (Toolbar, Panel, Export Options)

EventDescription
CustomizeElementsAllows you to customize the Web Document Viewer’s UI elements (Parameter Panel, Right Panel, Toolbar).
CustomizeMenuActionsEnables you to customize the Web Document Viewer’s toolbar.
CustomizeExportOptionsAllows you to customize the Web Document Viewer’s available export formats and corresponding export options.

Customize Parameter Editors

EventDescription
CustomizeParameterEditorsEnables you to provide custom editors for report parameters.
CustomizeParameterLookUpSourceAllows you to customize look-up report parameter values.

Manage Report Parameters

EventDescription
ParametersInitializedAllows you to get the client-side parameter values when they are initialized and modify them.

Respond to Parameter Reset and Submission

EventDescription
ParametersResetOccurs after report parameter values are reset to their default values.
ParametersSubmittedOccurs after report parameter values are submitted.

Respond to Document Loading

EventDescription
DocumentReadyOccurs after the Web Document Viewer loads a report document.

Manage Interactivity

EventDescription
PreviewClickOccurs when a report document is clicked.
EditingFieldChangedOccurs each time an edit field’s value changes.

Localize the Document Viewer

EventDescription
CustomizeLocalizationEnables you to replace the Web Document Viewer’s localization strings with custom strings.

Respond to Server-Side Errors

EventDescription
OnServerErrorOccurs on the client each time a server-side error is raised.

Initialize the Document Viewer

EventDescription
BeforeRenderOccurs before the Web Document Viewer UI is initialized.
OnInitializingOccurs before the View Model is fetched from the server, and before the BeforeRender event.

See Also

Tasks and Solutions for ASP.NET Core Applications