Hi,
I'm trying to you the client-side for export radgrid data.
I'm calling this function on the client click of my export button :
function ExportGridCsv()
{
var grid=$find("MyRadGrid");
if(grid)
grid.get_masterTableView().exportToCsv();
return false;
}
I've also add this function on ClientEvents-OnRequestStart of my RadAjaxPanel :
function BeginHandlerExport(AjaxPanel, args)
{
//Util pour l'export des datas
if (args.get_eventTarget().indexOf("btn_export") != -1)
args.set_enableAjax(false);
}
When i click on my button to export my data, a postback is done, needdatasource is called, but nothing happen next. I'm not able to export my radgrid data.
Have you any idea for solve this problem ?
Thanks a lot
I'm trying to you the client-side for export radgrid data.
I'm calling this function on the client click of my export button :
function ExportGridCsv()
{
var grid=$find("MyRadGrid");
if(grid)
grid.get_masterTableView().exportToCsv();
return false;
}
I've also add this function on ClientEvents-OnRequestStart of my RadAjaxPanel :
function BeginHandlerExport(AjaxPanel, args)
{
//Util pour l'export des datas
if (args.get_eventTarget().indexOf("btn_export") != -1)
args.set_enableAjax(false);
}
When i click on my button to export my data, a postback is done, needdatasource is called, but nothing happen next. I'm not able to export my radgrid data.
Have you any idea for solve this problem ?
Thanks a lot
5 Answers, 1 is accepted
0
Hello Mylène,
Please put the following button to your page and let me know whether this helps.
Regards,
Daniel
the Telerik team
Please put the following button to your page and let me know whether this helps.
<
asp:Button
ID
=
"btn_export"
runat
=
"server"
Text
=
"Export"
OnClientClick
=
"ExportGridCsv(); return false;"
/>
Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Mylène
Top achievements
Rank 1
answered on 18 Oct 2010, 10:21 AM
Hello,
Thanks for your answer, but I already added the button, and it didn't work.
After the postback, the Request("__EVENTARGUMENT") is FireCommand:MyRadGrid$ctl00;ExportToCsv;
Maybe that can help you. Do I have to add some functions in the server-side code?
Thank you
Thanks for your answer, but I already added the button, and it didn't work.
After the postback, the Request("__EVENTARGUMENT") is FireCommand:MyRadGrid$ctl00;ExportToCsv;
Maybe that can help you. Do I have to add some functions in the server-side code?
Thank you
0
Hello Mylène,
I'm not sure that you tried the code I posted below. Can you please copy the code exactly as is shown in the code-block in my previous post? Notice that you should add return false in the OnClientClick property.
Regards,
Daniel
the Telerik team
I'm not sure that you tried the code I posted below. Can you please copy the code exactly as is shown in the code-block in my previous post? Notice that you should add return false in the OnClientClick property.
Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Mylène
Top achievements
Rank 1
answered on 18 Oct 2010, 02:54 PM
Hello,
I copied the code exactly as you posted before answer :) but that didn't work.
That why I asked you if you can give me more details in the process, for find where the problem is.
I've added return false in the OnClientClick property.
The postback that I have is not the postback done by the click of the button, but done by the FireCommand that raise ExportToCsv.
But I don't know the process (if the export has to be done in serve side at the end)
Can you give me more details please ?
Thank you
I copied the code exactly as you posted before answer :) but that didn't work.
That why I asked you if you can give me more details in the process, for find where the problem is.
I've added return false in the OnClientClick property.
The postback that I have is not the postback done by the click of the button, but done by the FireCommand that raise ExportToCsv.
But I don't know the process (if the export has to be done in serve side at the end)
Can you give me more details please ?
Thank you
0
Hello Mylène,
There are two problems. First, if you ignore my advice to set return false you will have two requests - the first one is triggered by the button click and the second one is initiated by RadGrid.
The second problem is related to the first one - provided that RadGrid is the export initiator you won't be able to cancel the AJAX request by identifying the initiator control by its id.
Please examine the attached demo.
Kind regards,
Daniel
the Telerik team
There are two problems. First, if you ignore my advice to set return false you will have two requests - the first one is triggered by the button click and the second one is initiated by RadGrid.
The second problem is related to the first one - provided that RadGrid is the export initiator you won't be able to cancel the AJAX request by identifying the initiator control by its id.
Please examine the attached demo.
Kind regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items