I have followed this sample and it seems to work fine.
It looks to me like I followed the example but my code will only export the first page of the data and not all the records in the table.
}
Thanks!
It looks to me like I followed the example but my code will only export the first page of the data and not all the records in the table.
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
if (e.Argument == "exportCsv")
{
exportCsvActivity();
}
else if (e.Argument == "exportExcel")
{
exportExcelActivity();
}
}
protected void exportExcelActivity()
{
ConfigureExport();
this.gridActivity.MasterTableView.ExportToExcel();
}
public void ConfigureExport()
{
this.gridActivity.ExportSettings.ExportOnlyData = false;
this.gridActivity.ExportSettings.IgnorePaging = true;
this.gridActivity.ExportSettings.OpenInNewWindow = false;
this.gridActivity.MasterTableView.GetColumn("chkTemplate").Visible = false;
this.gridActivity.MasterTableView.GetColumn("messageIndex").Visible = false;
}
function
RadAjaxManager1_OnRequestStart(ajaxManager, eventArgs) {
if
(eventArgs.EventArgument ==
"exportCsv"
|| eventArgs.EventArgument ==
"exportExcel"
) {
eventArgs.EnableAjax =
false
;
}
}
function
exportCsv()
{
$find(
"<%= this.RadAjaxManager1.ClientID %>"
).ajaxRequest(
"exportCsv"
);
}
function
exportExcel()
{
$find(
"<%= this.RadAjaxManager1.ClientID %>"
).ajaxRequest(
"exportExcel"
);
}
<
asp:LinkButton
ID
=
"btnExportExcel"
runat
=
"Server"
Text
=
"Excel Export"
CommandName
=
"exportExcel"
CommandArgument
=
"exportExcel"
CssClass
=
"subPageLinks"
OnClientClick
=
"exportExcel(); return false;"
></
asp:LinkButton
>
Thanks!