I have a RadGrid with 2 levels of data hierarchy (Countries > Campaigns > Entries) . I only want to export the lowest level grid (Entries) to Excel.
For some reason, the Export isn't happening. The ItemCommand event with the CampaignsRadGrid.MasterTableView.ExportToExcel(); call is being hit though, but the only thing that happens is that the pagination controls, on the bottom of the grid, disappear.
Any thoughts? Thanks in advance for any help...
13 Answers, 1 is accepted
Try to use the below code to make it functioning. Hope it may help
Sys.InvalidOperationException: A control is already
associated with the element.
Removed this and the export works. only problem is that it seems to be exporting the master table's data, but with the detail table's fields. because the only common field between these two is "ID" that is the only column that contains data (in the exported Excel file).
Is it necessary to do a Rebind() or something similar? or should I be targeting the DetailTable when calling the ExportToExcel() method?
I'll try a few things and if I find a solution myself, I'll put it up here...
will cause the RadGrid to Rebind, which makes sense 'cause when the export method was called, the DetailTable had the same DataSource as the MasterTable.
setting IgnorePaging = false fixed my problem.
see here: http://www.telerik.com/community/forums/aspnet-ajax/grid/export-multi-level-hierarchy-radgrid.aspx#920000
In the Hierarchical Table I set Display="false" on certain columns to show a 'summary' of the data. No matter what I try, I cannot get those columns to export to Excel - it only ever exports the visible ones.
any ideas on what to do to make those columns display in the Export?
I had already tried marking the columns as Visible=true and Display=true, but to no avail.
In the end, I used a separate temporary (hidden) RadGrid for the export. Not ideal and not the most efficient solution, but time was against me...
You can try to traverse the columns recursively:
the Telerik team
kindly your advice about export detail table as you made before, just i want to know how to disable paging in detail table to export data when expand one record of main radgrid
Sorry dear, but in other word i want to do the following:
When clicking export in the detail table, export all records of the detail table (for that master table record).
any way to do that please
Exporting separate table views is not recommended and might not work as expected. The export buttons are working this way only because we would like to avoid breaking changes.
That said, if you let me know which export format is used in your project I may have a suggestion for that particular case.
i want to export the data into csv file, i use the same way that used in the first post of this conversation that introduce the way of exporting detail table for one record of grid that we expand and if detail table for that records takes more than one page i can't export all pages in detail table for one record of detail table that we expanded, but i can export only one page of that detail table.
please help me, just i want to export data of record from hierarchical radgrid that we expanded to csv file
You can try the following approach:
I hope this helps.