This example uses the browser's built-in dialog to print data displayed within the DevExpress Blazor Grid component.
To print Blazor Grid data, you must:
- Add a DevExpress Blazor Grid to a page and bind it to data.
- Add a DevExpress Blazor Button to the Grid Toolbar.
- In the button Click event handler:
- Disable the button to prevent repeated clicks while the request is being processed.
- Call the ExportToPdfAsync method to export Grid data to a PDF stream. The exported PDF reflects current Grid state (filters, sort order, and grouping) and is ready for printing.
- Wrap the PDF stream in a DotNetStreamReference and pass it to JavaScript.
- Re-enable the button.
- In JavaScript:
- Optional. Display the DevExpress Blazor Wait Indicator within the Print toolbar button while processing the print request.
(you will be redirected to DevExpress.com to submit your response)
