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: November 16, 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

Platform: ASP.NET Web Forms |
Control: Grid |
Published Date: September 22, 2015 |
Last Revised Date: September 22, 2015
Tags: exporting, grid

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

 

 

 

 

2X faster development

The ultimate ASP.NET Web Forms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

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