Show Dev Express Loading Panel using ASPxComboBox

I had a case where I wanted to show an ASPxLoadingPanel  when the user changed the the selection.  On a command button this is easy you just add a OnClientClick="ShowLoadingPanel()".

But since a Drop Down you need to show the loading panel on the Change Event DevExpress does not handle that unless you are doing a call back. In this case I had an 
ASPxComboBox on a page with an Update Panel and a Grid.

To get around this I added the following JavaScript in the C# code behind:

 BtnRefresh.Attributes.Add("onclick", "javascript:ShowLoadingPanel();");
Which calls...and shows the spinner.
    function ShowLoadingPanel() {     
         var prm = Sys.WebForms.PageRequestManager.getInstance();
         prm.add_initializeRequest(prm_InitializeRequest);
         prm.add_endRequest(prm_EndRequest);
     }
     function prm_InitializeRequest(sender, args) {
         LoadPnlAcctGridDev.Show();
     }
     function prm_EndRequest(sender, args) {
         LoadPnlAcctGridDev.Hide();
     }
Once the Grid is reloaded the spinner is gone...
Comments are closed