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

Export to pdf of Rad Grid in Hierarchical manner on a image button

1 Answer 25 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kalpna
Top achievements
Rank 1
Kalpna asked on 22 Feb 2014, 11:41 AM
Hello All,
I am exporting my Rad Grid data in a pdf form but it is not showing my data in a hierarchical manner and not showing data.
 Please see the below attachment and i also write my code for exporting the data in pdf form.

Please help me. It is urgent.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Feb 2014, 06:54 AM
Hi Kalpna,

Please try the following code snippet on the export to PDF button to export all the detail tables.

C#:
protected void PDFExportbtn_Click(object sender, EventArgs e)
{
  RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
  if (RadGrid1.MasterTableView.HasDetailTables)
  {
    foreach (GridTableView gridTableView in RadGrid1.MasterTableView.DetailTables)
    {
        gridTableView.HierarchyDefaultExpanded = true;
    }
  }
  RadGrid1.Rebind();
  RadGrid1.MasterTableView.ExportToPdf();
}

Thanks,
Princy
Tags
General Discussions
Asked by
Kalpna
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or