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

Export with RadAjaxManagerProxy not working

5 Answers 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Spedia
Top achievements
Rank 1
Spedia asked on 23 Jul 2008, 11:05 AM
I have followed a number of posts here to get the export button to work whilst using a RadAjaxManagerProxy. It does, work in the sense that the page postback is done via AJAX. The loadingPanel appears and it seems to start doing its stuff. However, this is where the success ends. It simply stops loading and then presents me with the same page (except bizarely this time some of the pages elements have been nudged to the right by about 50 pixels).

I followed some forums to wire up the OnRequestStart method to the RadAjaxManager in the master.template. As I said, this seems to be working in the sense that the postback is now handled by AJAX and the loading panel. For clarity, this is the code i have used to achieve this part:

RadAjaxManager oAjaxMan = (RadAjaxManager)this.Page.Master.FindControl("RadAjaxManager1");
            oAjaxMan.ClientEvents.OnRequestStart = "mngRequestStarted";

Now, as mentioned this is where my luck runs out. Is there anything i am missing? I have added the following to the RadGrid:

<ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true"></ExportSettings>

So i would expect a new page to open and present me with the open / save dialog box. But it doesn't. One other thing i noticed when following instructions in other posts was to make use of a AjaxSettingCreating method... but i haven't done this as i do not know what it is for. Maybe this is where i have gone wrong?

Really hoping someone is able to help. Please let me know if you need any extra information from me.

Thanks in advance

Ben

5 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 24 Jul 2008, 11:27 AM
Hello Spedia,

Please go through the following online help article to see where your approach diverges from the specified requirements:

Export from ajaxified grid

Also please note that if you are using master/content pages, your AjaxRequest javascript event handler should be placed on the page where you have defined your RadAjaxManager. Please share with us your observations.

Regards,
Veli
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ronnie
Top achievements
Rank 1
answered on 06 Aug 2008, 05:58 PM
I am experiencing the same problem.  The example from your website works until you place the RadGrid and button inside an AJAX TabPanel.  Then the export no longer functions.  Do you have a work around for this?
0
Sebastian
Telerik team
answered on 07 Aug 2008, 08:43 AM
Hello Ronnie,

If you disable the ajax explicitly before the export operation takes place, everything should work as expected. You may be interested in reviewing the sample projects from the code library thread linked below for more details:

http://www.telerik.com/community/code-library/submission/b311D-ttcbe.aspx

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ronnie
Top achievements
Rank 1
answered on 07 Aug 2008, 03:32 PM
I have disabled ajax explicitly with the following code and it still does not work.
 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    
<script type="text/javascript">
        function mngRequestStarted(ajaxManager, eventArgs)
        {
            
if(eventArgs.EventTarget == "OneDataExtractButton" || eventArgs.EventTarget == "TwoDataExtractButton")
            {
                eventArgs.EnableAjax = false;
            }
        
}
    </script>
</telerik:RadCodeBlock>

I also downloaded your sample ExportToExcelWordWithAjaxEnabled_Web_UI.zip and just placed your first grid and buttons that are
ajaxfied through RadAjaxManager inside an ajax TabContainer and the exports no longer function.  The buttons do cause a post back and the correct code appears to be called but the export dialog never displays.
0
Ronnie
Top achievements
Rank 1
answered on 07 Aug 2008, 03:55 PM
I got it working.  I had to prefix the names of the buttons with their location inside the ajax TabContainer.

function
mngRequestStarted(ajaxManager, eventArgs)
    {
        if(eventArgs.EventTarget == "TabContainer1$TabPanel1$mngBtnExcel" || eventArgs.EventTarget == "TabContainer1$TabPanel1$mngBtnWord" || eventArgs.EventTarget == "TabContainer1$TabPanel1$mngBtnCSV" || eventArgs.EventTarget == "TabContainer1$TabPanel1$mngBtnPDF")
        {
            eventArgs.EnableAjax = false;
        }
    }

Thanks for all the help.
Tags
Grid
Asked by
Spedia
Top achievements
Rank 1
Answers by
Veli
Telerik team
Ronnie
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or