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

Radgrid Export to Excel not working

1 Answer 241 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Elavarasan
Top achievements
Rank 1
Elavarasan asked on 02 Apr 2014, 09:50 AM
Hi,

I have a Telerik Radgrid and I have a button. On click of the button, I try to export the content in the grid to an Excel file. PFB the code I have used for that.

​string alternateText = "ExcelML";
RadGrid1.ExportSettings.Excel.Format = (GridExcelExportFormat)Enum.Parse(typeof(GridExcelExportFormat), alternateText);
RadGrid1.ExportSettings.ExportOnlyData = true;
RadGrid1.ExportSettings.IgnorePaging = true;
RadGrid1.ExportSettings.OpenInNewWindow = true;
RadGrid1.MasterTableView.ExportToExcel();


I have debugged the code and it enters the loop, accesses every line of code and exits the loop with no exception. But the content is not exported to any excel. Please help ASAP

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Apr 2014, 10:52 AM
Hi Elavarasan,

The exporting feature works only with regular postbacks. This means, that the asynchronous postback should be canceled when performing an export. To bypass the limitation you can wire the OnRequestStart event of the ajax panel or ajax manager, determine whether the target control is ajaxified and explicitly disable its ajax mode to export with regular postback.
Please have a look at this article on Export from Ajaxified Grid. If this doesn't help, provide your full code snippet.

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