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

[Solved] Exporting Hierarchy grid

3 Answers 155 Views
Grid
This is a migrated thread and some comments may be shown as answers.
PM
Top achievements
Rank 1
PM asked on 01 Dec 2009, 05:26 AM
Hi All,

I have a Hierarchy RadGrdi, in master table i have some columns and in chield table i have some columns,

when i click export (excel, pdf,doc) i want to export both the master table and child table columns.

How can i do this. Please help me regarding this.

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 01 Dec 2009, 08:50 AM
Hello Praveen,

Please examine the code snippet bellow and let me know if it works for you.
C#:
protected void Button1_Click(object sender, EventArgs e)
    {
        ConfigureExport();
        RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
        RadGrid1.Rebind();
        RadGrid1.MasterTableView.ExportToExcel();
    }
    public void ConfigureExport()
    {
        RadGrid1.ExportSettings.ExportOnlyData = true;
        RadGrid1.ExportSettings.IgnorePaging = true;       
    }

If you need additional assistance, do not hesitate to let us know.

All the best,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
PM
Top achievements
Rank 1
answered on 04 Dec 2009, 12:23 PM
thank you for the reply.

if we want to do it on client side export what should i do.

is it possible?
0
Pavlina
Telerik team
answered on 04 Dec 2009, 01:27 PM
Hello Praveen,

To export hierarchy grid client side, please verify that you set the HierarchyDefaultExpanded property at each level of the hierarchy (master or child tables) to true before invoking the ExportToExcel method.

All the best,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
PM
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
PM
Top achievements
Rank 1
Share this question
or