I come across some problem with the exporting. The issue is that I can't export all the record in the grid even I set "IgnorePaging" to true; it only save the current page. The RadGrid is on a updatepanel, and the event for imagebutton click as follows
protected void ImgbtExcel_Click(object sender, ImageClickEventArgs e)
everytime it only save the current page.
12 Answers, 1 is accepted
So I removed all the update panel and also the tabstrip only RadGrid and a image button, but I got the same issue.
BTW, I assign the datasource in the code not using sql datasource, don't know whether that's the issue.
and the setting is:
exportonlydata="True" filename="EmployeeDetails" ignorepaging="True"
openinnewwindow="True"><Excel Format="ExcelML" />
any one knows about this problem?
I tried exporting with IgnorePaging property set to true and it is working as expected. One another suggestion will be to disable paging in the click event of the Export button so that the entire Grid data will get exported.
Please let us know how you populated your RadGrid. I suggest you consider adding a NeedDataSource handler and bind the control inside this handler.
More information about NeedDataSource:
Advanced data-binding w/NeedDataSource
Let us know if you need further assistance.
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
thanks for the code and suggestions.
Before for some reason I binded the datasource in Page_Prerender event and it's not working for the "export all",now I bind the radgrid datasoure in the needdatasource event,and it's working.
But as I used an updatepanel which contains the radgrid to do an Asynchronize postback triggered by a button outside the panel, when the page loads it did not call the needdatasource event to load the new datasource, so I have to rebind it every time on the Page_load event, but this doesn't seem to be a right way. do I need to chage the update panel to Asynchronize manager to do the job?
I have another question about the RadGrid Export, is there any way for doing export process on the client side, I saw the functions on the client side for exporting
The exporting feature of the control work with regular postbacks only.The reason is the grid prepares additional information when performing export operation (available on postback). When the action is performed through asynchronous requests, this information can not be passed through the XMLHttpObject - that is why the communication between the browser and the server fails. Go through the following help article for getting more details on this regard.
Export from ajaxified grid
Try the following code snippet to export the Grid from the client side.
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
var masterTable = $find("<%=RadGrid1.ClientID %>").get_masterTableView();
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True"
<Selecting AllowRowSelect="true" />
<input id="Button1" type="button" value="Export" onclick="ExportGrid()" />
Exporting from a client-side data-bound grid is not a scenario supported by the RadGrid control.
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.
I have a rad grid in an rad ajax panel, and a button that exports the grid to excel. I have mentioned the Filename of the excel file.
When I click the button, a popup opens up with options to Open, Save or Cancel.
Save works fine with the proper name of file, but if I choose open, I get a weird name.
GridSalary.ExportSettings.FileName = HttpUtility.UrlEncode("Test", System.Text.Encoding.UTF8);
Open click gives me this name : %54%65%73%74.xls
This is happening only in IE 7, Firefox there is no issue.
I am using 2009 Q2 rad controls.
Give this approach a try. It will override the filename encoding.
the Telerik team
Kudos to you. It worked like a charm. Thanks a ton for your prompt help with this.