This is a migrated thread and some comments may be shown as answers.

PDF Exporting two seperate Grids

2 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chuck
Top achievements
Rank 1
Veteran
Chuck asked on 09 Apr 2021, 02:25 PM

I have a requirement to display to seperate RadGrids, which I can do successfully (https://www.telerik.com/forums/displaying-the-same-grid-on-two-different-pages)

But now I need to be able to export both to PDF & Excel from the CommandItemTemplate LinkButton. This process works of course for one of the Grids but not both. How do I get that CommandItem to fire for both my grids? 

2 Answers, 1 is accepted

Sort by
0
Chuck
Top achievements
Rank 1
Veteran
answered on 12 Apr 2021, 02:53 PM
Investigating further, I'm finding that once the PDF export command is clicked, in the "ItemDataBound" Event, the sender is correctly executing both Grids, but the "GridItemEventArgs" event is only providing the data items for the second grid, Dim dataItem As GridDataItem = TryCast(e.Item, GridDataItem)

Why wouldn't the "e.Item" for each sender be processed?
0
Doncho
Telerik team
answered on 14 Apr 2021, 12:50 PM

Hi Chuck,

When in the command item of a Grid, the ExportToPdf or ExportToExcel button is clicked, a command (see Command Reference) will be fired specifically for this grid hence it will be exported.

As to exporting two RadGrids simultaneously: Unfortunately, sending two separate files to the client is not possible within a single HTTP request. In case you want to export both Grids in a single file please check out and try the approach in our Export Multiple Grids demo.

Please let me know if any further questions come up.

Kind regards,
Doncho
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Tags
Grid
Asked by
Chuck
Top achievements
Rank 1
Veteran
Answers by
Chuck
Top achievements
Rank 1
Veteran
Doncho
Telerik team
Share this question
or