6 Answers, 1 is accepted
0
Accepted
Hello Abdul,
The grid supports automatic export to Excel/Word/PDF. You can show the built-in export buttons from the CommandItemSettings for the grid by setting ShowExportToExcelButton="true". Please have a look at the following demo showing the various exports functionalies for the grid and how they are configured.
Greetings,
Marin
the Telerik team
The grid supports automatic export to Excel/Word/PDF. You can show the built-in export buttons from the CommandItemSettings for the grid by setting ShowExportToExcelButton="true". Please have a look at the following demo showing the various exports functionalies for the grid and how they are configured.
Greetings,
Marin
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0

Abdul
Top achievements
Rank 2
answered on 29 Nov 2010, 08:40 AM
by setting this property to true it just refresh the grid on click does not give an option to download the excel file, i have manually called the ExportToExcel method but still not working
<
telerik:RadGrid
ID
=
"grd_report"
runat
=
"server"
AllowPaging
=
"True"
OnNeedDataSource
=
"grd_report_NeedDataSource"
AllowAutomaticDeletes
=
"True"
Skin
=
"Web20"
AllowSorting
=
"True"
GridLines
=
"None"
OnItemCommand
=
"grd_report_ItemCommand"
>
<
MasterTableView
Width
=
"100%"
CommandItemDisplay
=
"Top"
>
<
PagerStyle
Mode
=
"NextPrevNumericAndAdvanced"
/>
<
CommandItemSettings
ShowExportToExcelButton
=
"true"
ShowAddNewRecordButton
=
"false"
/>
</
MasterTableView
>
</
telerik:RadGrid
>
protected void grd_report_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToExcelCommandName)
{
grd_report.MasterTableView.ExportToExcel();
}
}
0

Abdul
Top achievements
Rank 2
answered on 29 Nov 2010, 08:50 AM
Is there any relation in the download option and telerik header I have used the normal html header
0

Abdul
Top achievements
Rank 2
answered on 29 Nov 2010, 08:50 AM
do i need to add javascript for exporting grid contents to excel even on export to excel button enables ?
0

Abdul
Top achievements
Rank 2
answered on 29 Nov 2010, 10:30 AM
<script type="text/javascript">
function onRequestStart(sender, args)
{
if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
args.get_eventTarget().indexOf("ExportToCsvButton") >= 0)
{
args.set_enableAjax(false);
}
}
</script>
This block of code is must... please change it according to your need
function onRequestStart(sender, args)
{
if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
args.get_eventTarget().indexOf("ExportToCsvButton") >= 0)
{
args.set_enableAjax(false);
}
}
</script>
This block of code is must... please change it according to your need
0
Hello Abdul,
the Telerik team
To clarify: The exporting feature works only with regular postbacks. This means that if you have ajaxified grid, you should temporary disable the asynchronous postback to allow the save window to pop up. You can get more information in this help article: Export from ajaxified grid. One possible option is to wire the OnRequestStart event for the AjaxManager with the following code as you already found:
function onRequestStart(sender, args)
{
if
(args.get_eventTarget().indexOf(
"ExportToExcelButton"
) >= 0)
{
args.set_enableAjax(
false
);
}
}
Best wishes,
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.