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

Grid Export

1 Answer 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
arnaud
Top achievements
Rank 1
arnaud asked on 15 Mar 2010, 06:39 PM
Hi,

Exporting data from a grid can sometimes be very long.

Taking this example : http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/exporting/defaultcs.aspx

When you have a lots more data, nothing warns the user that something is in process. I was thinking showing the loadingpanel over the grid on button click and hide it when the export process is done.

Showing the loadingpanel over the grid on export click :

function onRequestStart(sender, args) { 
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 || 
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0) { 
                     var currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID %>"); 
                    currentLoadingPanel.show("<%= RadGrid1.ClientID %>"); 
 
                    args.set_enableAjax(false); 
                } 
            } 

However I can'tcatch a event to hide the loadingpanel once the export process is finished (when the user is prompted to dl or open the file).

I've already tried :

- the pageLoaded event of the ASP.NET AJAX framework :
ScriptManager.RegisterStartupScript(Me.Page, Me.Page.GetType, "P_hide", "Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded);", True)

function pageLoaded(sender, args) {
                var currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID %>");
                currentLoadingPanel.hide("<%= RadGrid1.ClientID %>");
            }


- the export button's OnClick server :
RadAjaxManager1.ResponseScripts.Add(...)

Thank You



1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Mar 2010, 10:06 AM
Hello Arnaud,

I'm afraid there is no easy way to stop the loading panel automatically since the response is redirected to the client and all the changes you have made will affect the exported file only.

The easiest approach could be to put an OK button that will refresh the page manually.

Best regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
arnaud
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or