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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Exporting Excel File from Grid with AsyncPostBack Trigger in Update Panel

Thread ID:

Created:

Updated:

Platform:

Replies:

145036 Jun 3,2019 06:06 PM UTC Jun 5,2019 12:12 PM UTC ASP.NET Web Forms 3
loading
Tags: Grid
Matt Broich
Asked On June 3, 2019 06:06 PM UTC

Hi,

I currently have a grid within an UpdatePanel element. In order to update the row(s)/database I have said grid linked to a AsyncPostBack Trigger. Is there any way I could export an excel/pdf file without the "isLocalSave" property or using the PostBack Trigger, since the AsyncPostBack only does a partial page reload? 

I would also like to only use Syncfusion elements if possible.

Thanks!

Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On June 4, 2019 09:42 AM UTC

Hi Matt, 

Query#:- I have said grid linked to a AsyncPostBack Trigger. Is there any way I could export an excel/pdf file without the "isLocalSave" property or using the PostBack Trigger. 
 
We have checked your query and we have already discussed this requirement “How to export the data when Grid is in update panel” in our Syncfusion knowledge Base. 
 
Also refer to the code example:- 
<asp:UpdatePanel runat="server"> 
<ContentTemplate> 
     <ej:Grid ID="Grid1" runat="server" AllowSorting="True" OnServerWordExporting="FlatGrid_ServerWordExporting" OnServerPdfExporting="FlatGrid_ServerPdfExporting" OnServerExcelExporting="FlatGrid_ServerExcelExporting" AllowPaging="True"> 
            .   .   . 
        </ej:Grid> 
</ContentTemplate> 
   
<Triggers> 
<asp:PostBackTrigger controlid="FlatGrid"/> 
</Triggers> 
</asp:UpdatePanel> 
 
 
Refer to the KB link:- 
 
Please get back to us if you need any further assistance. 
 
Regards, 
Farveen sulthana T 


Matt Broich
Replied On June 4, 2019 02:51 PM UTC

Hi Farveen,

Thank you for the quick response, however, this did not solve my issue. Whenever I click on the "exportExcel" button I receive the following error: 
Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Thread was being aborted.

This error is caused by the Asynchronous PostBack within the update panel. However, I need the AsyncPostBackTrigger in the update panel to update my grid/database. Is there a way to dynamically switch between the PostBackTrigger and AsyncPostBackTrigger depending on which toolbar button you click? As you cannot have both triggers on the same element.

For instance, I have the Update, Cancel, Excel Export, and PDF Export buttons within my grid's toolbar. Would it be possible to switch triggers from being an AsyncPostBackTrigger to a PostBackTrigger on the Excel and PDF Export buttons? And once the Update button is clicked, switch it back to the original state? 

Thanks!

Manivannan Padmanaban [Syncfusion]
Replied On June 5, 2019 12:12 PM UTC

Hi Matt, 

Query: Is there a way to dynamically switch between the PostBackTrigger and AsyncPostBackTrigger depending on which toolbar button you click? 

From the above query, we are able to understand that you want to change the trigger from AsyncPostBackTrigger  to PostBackTrigger. We can able to change the trigger in the code bebind kindly refer the below general link, 

Using the customtoolbar, render the own toolbar item in toolbar. And in the custom toolbar click event call the server end function and then change the trigger based on the above link.  For customToolbar rendering refer the below code example, 

Or you can use the external button click to change the trigger from AsyncPostBackTrigger  to PostBackTrigger before exporting. 

Regards, 
Manivannan Padmanaban. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

Live Chat Icon For mobile
Live Chat Icon