1

I'm using radgrid. When I click the export button, the Rad Ajax Loading Panel shows up but never closes after the export process completes.

Do you have any idea about this problem?

Mark Hurd
  • 10,665
  • 10
  • 68
  • 101
Jack
  • 167
  • 1
  • 7

1 Answers1

1

Hi I've found my solution :) I've remove the connection between AjaxPanel and AjaxLoadingPanel. After than i trigged the AjaxLoadingPanel explicitly. Here is the code i used to.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
     <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="btnList">
         <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
     </AjaxSettings>
     <ClientEvents OnRequestStart="ResponseEnd" />
</telerik:RadAjaxManager>

And the java script

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
    var currentLoadingPanel = null;
    var currentUpdatedControl = null;
    function ResponseEnd(sender, args) {
        //hide the loading panel and clean up the global variables
        if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
            args.set_enableAjax(false);
        }

        currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID %>");

        if (args.get_eventTarget() == "<%= btnList.UniqueID %>") {
            currentUpdatedControl = "<%= RadAjaxPanel1.ClientID %>";
        }
        else {
            currentUpdatedControl = "<%= RadAjaxPanel1.ClientID %>";
        }
        if (currentLoadingPanel != null)
            currentLoadingPanel.hide(currentUpdatedControl);
        currentUpdatedControl = null;
        currentLoadingPanel = null;
    }
</script>

Jack
  • 167
  • 1
  • 7
  • I don't follow how this would have worked. There are lots of issues with this code (you're doing this in OnRequestStart and the code setting currentUpdatedControl does not look right) and it seems like an incomplete solution. – Itison Feb 20 '14 at 22:44
  • Mate i had the problem and i'd solved the problem. it worked for me as well. So i just wanted to share the solution – Jack Jul 09 '14 at 11:28
  • My apologies, I didn't mean for it to sound as harsh as it did. I'm still not sure how it could have worked for you though, because this looks to me like it would always hide the panel right away. What worked for me, is basically calling show where you called hide, then repeatedly polling for a download token like this: http://www.telerik.com/support/code-library/show-loading-panel-when-exporting-radgrid – Itison Jul 15 '14 at 00:48
  • Also about the code not looking right, what I meant was you have OnRequestStart="ResponseEnd" and also where you set currentUpdatedControl it looks like: if (x) y; else y; So I thought maybe you copy/pasted some older code as I'm not sure what the if/else statement is for. – Itison Jul 15 '14 at 00:48
  • Hi @Itision, it's been while :) I think I've showed oversensitiveness. Sorry for that ;) You were right. In many years I have not login here. I've saw this post today. :) I don't even remember what was the issue:) Best wishes – Jack Apr 16 '19 at 19:52