We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to export the data when grid is in UpdatePanel

When the grid is in Update Panel the partial post will be done and hence exporting will not work in grid.

Although we can achieve the Exporting using below two ways.

  1. By making the grid as Post Back control
  2. Saving the Exported file instead of downloading

 

  1. By making the grid as Post Back control.

We can change the post back grid as post back control by using PostBackTrigger in the Default.aspx page. Now the grid will send post back on its operation and hence the export will work as expected.

Example:

Grid rendering control:

ASP:

 

  1. Saving the Exported file instead of downloading

If we don’t want to use the grid as a post back control then we can save the exported file in the specified location instead of downloading.

We can set the “isLocalSave” property as true and also set the path for the property filePath of the Export method for saving the exported file in the specified file path.

Example:

 

Note: if the exported file exists already then the new file will be replaced in the same folder.

The above code example will work for both Word and PDF also.

 

Result:

                                            Figure: Exported file

 

 

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
5442 09/22/2015 09/22/2015 ASP.NET Web Forms Grid
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon