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

RadGrid - Export to excel with a few rows grouped

1 Answer 161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vasanth
Top achievements
Rank 1
Vasanth asked on 24 Jan 2013, 07:33 PM
Hi,

I have a requirement in my project that i have to export the data from RadGrid to excel.

This can be achieved by using the following command:

.MasterTableView.ExportToExcel();

But i want a few rows in the excel (which is exported) grouped by means of expand and collapse feature to the left of the row.

Please find attached the screenshot.

Thanks in advance

Regards, Vasanth

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Jan 2013, 05:34 AM
Hi,

I suppose you want to show ExpandCollapse button when exporting. Here is the sample code.
C#:
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.ExportToExcelCommandName)
        {
            RadGrid1.ExportSettings.HideStructureColumns = false;
            RadGrid1.Rebind();
        }
 }

Thanks,
Shinu
Tags
Grid
Asked by
Vasanth
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or