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 :
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
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