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

Export levels of hierarchical radgrid

5 Answers 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ivy
Top achievements
Rank 1
Ivy asked on 18 Sep 2013, 07:03 PM
I have a hierarchical grid with 3 levels (MasterTableView and 2 DetailTables).  I want to export each level separately depending on the option the user has selected.  I could not find a solution to get the levels exported.  Any help is appreciated.  Thanks

5 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 23 Sep 2013, 10:11 AM
Hello Ivy,

RadGrid does not provide such functionality and you have to build it manually. You could call ExportToExcel() method for each TableView which you want to export. Note that by using this approach every table will be exported in a separate excel file. If you want to export all of the tables in a single file but in different spread sheets you have to use the ExportInfrastructrure. You could check out the following example which demonstrates how to use it in such scenarios.

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Ivy
Top achievements
Rank 1
answered on 23 Sep 2013, 01:58 PM
Thanks for the suggestion, Kostadin.  Could you please provide an example of how to call ExportToExcel() for each TableView? It is fine if each of the tables are exported in separate files.  
0
Accepted
Kostadin
Telerik team
answered on 26 Sep 2013, 08:55 AM
Hello Ivy,

You could achieve that by setting CommnadItemDisplay and enabling the export to excel button. I attached a small runnable so you could give it a try and let me know about the result.

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Ivy
Top achievements
Rank 1
answered on 26 Nov 2013, 09:03 PM
Kostadin,

Would you be able to help me figure out how to export, let's say for example level 2 of the hierarchy grid (DetailTable1) with all the rows? I have set AllowPaging="true" and PageSize="5" for the GridTableView and also added ExportSetting's IgnorePaging="true", but its only exporting the initial 5 rows.

<
ExportSettings ExportOnlyData="true" HideStructureColumns="true" IgnorePaging="true"></ExportSettings>

<
telerik:GridTableView Name="DetailTable1" DataKeyNames="Column4" CommandItemDisplay="Top" CommandItemSettings-ShowExportToExcelButton="true" AllowPaging="true" PageSize="5">

Thanks!
0
Accepted
Kostadin
Telerik team
answered on 29 Nov 2013, 09:32 AM
Hi Ivy,

A possible solution is to disable the paging and rebind the TableView. I modified the sample from my previous reply and attached it again.

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Ivy
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Ivy
Top achievements
Rank 1
Share this question
or