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

[Solved] Export grid with hierarchal tables?

1 Answer 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas Brown
Top achievements
Rank 1
Thomas Brown asked on 07 Dec 2009, 11:01 PM
Can a grid with hierarchal tables be exported? None of the hierarchal samples have the ability to export.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 Dec 2009, 04:37 AM
Hello Thomas,

You can try out the following code to export a hierarchical grid with its child table:
c#:
protected void Button1_Click(object sender, EventArgs e) 
    { 
        RadGrid1.ExportSettings.OpenInNewWindow = true
        RadGrid1.ExportSettings.ExportOnlyData = true;         
        RadGrid1.AllowPaging = false
        RadGrid1.MasterTableView.HierarchyDefaultExpanded = true
        RadGrid1.Rebind();      
        RadGrid1.MasterTableView.ExportToExcel();  
    } 

Thanks
Princy.
Tags
Grid
Asked by
Thomas Brown
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or