4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 17 May 2012, 12:11 PM
Hi,
Please make sure that you consume the webservice on the server and not on the client. When bound on client RadGrid does not persist data that will be used when export on server.
Thanks,
Shinu
Please make sure that you consume the webservice on the server and not on the client. When bound on client RadGrid does not persist data that will be used when export on server.
Thanks,
Shinu
0
Den
Top achievements
Rank 1
answered on 21 May 2012, 07:48 AM
Hi.
The grid uses client binding. Is there any workaround to do export?
The grid uses client binding. Is there any workaround to do export?
Thanks.
0
Shinu
Top achievements
Rank 2
answered on 21 May 2012, 08:28 AM
Hi Den,
You have to bind RadGrid on the server only when exporting. Try this approach:
ASPX:
C#:
Thanks,
Shinu.
You have to bind RadGrid on the server only when exporting. Try this approach:
ASPX:
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Export"
OnClick
=
"Button1_Click"
/>
<
telerik:RadGrid
ID
=
"RadGrid2"
AllowSorting
=
"true"
AllowPaging
=
"true"
...
<ClientSettings>
<
DataBinding
Location
=
"~/MyWebService.asmx"
EnableCaching
=
"true"
SelectMethod
=
"GetData"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
C#:
protected
void
Button1_Click(
object
sender, EventArgs e)
{
RadGrid1.DataSource = MyWebService.GetData();
RadGrid1.Rebind();
RadGrid1.MasterTableView.ExportToCSV();
}
Thanks,
Shinu.
0
Den
Top achievements
Rank 1
answered on 21 May 2012, 08:47 AM
Thanks for your help. It works.