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

Export radgrid to excel

1 Answer 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 03 Dec 2012, 01:11 PM
Hello ,

I have rad grid having allgeneratecolumn true, I have bind it dynamically with datasource.
I am exporting the data to excel, but now I want to export only headers of grid to excel not the data
I want only headers of grid in exported excel.

Thanks
Amit

1 Answer, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 03 Dec 2012, 01:58 PM
Hello,

protected void RadGrid1_GridExporting(object sender, GridExportingArgs e)
    {
        string strOutput = e.ExportOutput;
        e.ExportOutput = strOutput.Substring(0, strOutput.IndexOf("<tbody>")) + strOutput.Substring(strOutput.IndexOf("</tbody>") + 8);
    }


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Amit
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or