This is a migrated thread and some comments may be shown as answers.

Export RadGrid content to Excel with Ajax enabled --> Re-Enable Ajax afterwards?

4 Answers 295 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 23 May 2012, 09:55 AM
I followed your great documentation on Export RadGrid content to Excel/Word/CSV/PDF with Ajax enabled . It works flawlessly - the export itself.

My javascript code is very close to the example code provided:
function requestStart(sender, args) {
    if (args.get_eventTarget().indexOf("lnkExportExcel") >= 0)
        args.set_enableAjax(false);
}


But after exporting the AJAX remains disabled. How do I re-enable AJAX after the RadGrid has been exported? Do i need to refresh the whole page or is there something like "radGrid.Re-EnableAJAX()" via Javascript?

Maybe you could update your documentation on re-enabling Ajax as well.

4 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 23 May 2012, 10:45 AM
Hello Dennis,

In your page ajax is already enabled.
If fire click event of lnkExportExcel then and then only it disable ajax else it already enabled.

Note : Please check this Export in Radgrid demo.
In this demo when you export at that time it disable ajax.
but after exporting when we change the paggging,  at that time ajax is already enabled (means not need to re enable).


Thanks,
Jayesh Goyani
0
Shinu
Top achievements
Rank 2
answered on 23 May 2012, 10:52 AM
Hello Dennis,

When the Ajax is enabled on the server it should be enabled by default after every postback even if you disable it on the client. This happens because the enabled setting is not persisted when changed client side and the next time the page loads it will be enabled again. Additionally you can try to place the LinkButton outside the Panel which is ajaxified. Also take a look at the following help documentation.
Export from Ajaxified Grid.

Thanks,
Shinu.
0
Dennis
Top achievements
Rank 1
answered on 23 May 2012, 11:26 AM
Thanks for the information and you are correct. When I load my UserControl in a regular web application AJAX works after clicking the Excel Button, however when using the userControl in SharePoint (on an Application page) Ajax doesn't work anymore, though it looks like a Postback.

Any experiences on how SharePoint might interfere with the export?
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 23 May 2012, 11:52 AM
Hello Dennis,

Can you please post your question in sharepoint forum so you get reply/answer quickly.

http://www.telerik.com/community/forums/sharepoint-2007.aspx
http://www.telerik.com/community/forums/sharepoint-2010.aspx

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Dennis
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Dennis
Top achievements
Rank 1
Share this question
or