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

LoadingPanel on IntiailLoad

4 Answers 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 21 Feb 2012, 10:56 AM
Hi,
I have quite an intensive database query returning a dataset to a radGrid in the needdatasource.  Depending on what the user selects it could take some time.  Rather than have the previous page continue to try and load and the finally display the page i would like to display the page and have a loading panel inside the radgrid to symbolize its still loading data from the back end.

I have tried many solutions found on this site but with no luck.

Using the ajaxmanager and making a call to the code behind doesn't display the loading panel for long enough it just appears then disappears instantly (setting a minimum time shows it for longer but this wont disappear when the datas loaded).

Also, the below doesn't seem to do as i need it still just waits for ages between loading the page.
<telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
   <AjaxSettings>
       <telerik:AjaxSetting AjaxControlID="rgComparison">
           <UpdatedControls>
               <telerik:AjaxUpdatedControl ControlID="rgComparison" LoadingPanelID="RadAjaxLoadingPanel1" />
           </UpdatedControls>
       </telerik:AjaxSetting>
   </AjaxSettings>
   </telerik:RadAjaxManager>
 
       <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

Help!

Thanks,
Michael

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Feb 2012, 11:12 AM
Hello,

Check the following help documentation.
Show RadAjaxLoadingPanel on Initial Page Load.

Thanks,
Princy.
0
Michael
Top achievements
Rank 1
answered on 21 Feb 2012, 12:41 PM
This is one of the things i tried, and the grid does indeed lazy load once the page is rendered. However, i don't see any loading designs (no circular loading image etc). Heres the code i've used, you'll see i've slightly modified the RadAjaxLoadingPanel from the code in the link above.

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function pageLoad(sender, eventArgs) {
            if (!eventArgs.get_isPartialLoad()) {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("InitialPageLoad");
            }
        }     
    </script>
</telerik:RadCodeBlock>
 
      <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>
                <asp:Panel ID="Panel1" runat="server">
                    <asp:Panel ID="Panel2" Visible="false" runat="server">
 ** rad grid here **
    
                       </asp:Panel>
                </asp:Panel>
                <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" skin="Vista" />


Code behind:

Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs)
      If e.Argument = "InitialPageLoad" Then
          'simulate longer page load
          System.Threading.Thread.Sleep(2000)
          Panel2.Visible = True
          rgComparison.Rebind()
      End If
  End Sub


Thanks,
Michael
0
Michael
Top achievements
Rank 1
answered on 22 Feb 2012, 12:00 PM
bump still stuck on this. 
0
Maria Ilieva
Telerik team
answered on 24 Feb 2012, 11:09 AM
Hi,

The problem you are facing is caused due to the fact that during the Load the RadGrid is still not bind and its height is null which means that the height of its container Panel1 is also zero.  So in case you have RadGrid in the updated panel you should set a height to the Panel 1 container in order the RadAjaxLoadingPanel to have a proper sized control to show on.

I hope this help.

All the best,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Michael
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or