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

RadAjaxLoadingPanel not loading

3 Answers 80 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Ronen
Top achievements
Rank 1
Ronen asked on 16 Feb 2011, 01:02 PM
i have a radgrid and an asp button which loads the data to the radgrid from the database, i want to display a waiting icon until the server response with the data to fill the grid, i am trying this and it doesn't display anything:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testloadingpage.aspx.cs" Inherits="testloadingpage" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl">
<head id="Head1" runat="server">
    <link rel="stylesheet" type="text/css" href="css/Style.css" media="screen" />
    <title>mailing lists</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
     <telerik:RadAjaxManager ID="RadAjaxManager1"
            runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="Button1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridMailingList" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGridMailingList">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridMailingList"
                            UpdatePanelHeight=""  LoadingPanelID="RadAjaxLoadingPanel1"/>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
       <div id="mailingList" class="contentBlock">
     
            <div class="submitButton">
                            <asp:Button ID="Button1" runat="server" Text="run query" OnClick="Button1_Click" />
            </div>
                <!-- content start -->
                 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
                <telerik:RadGrid ID="RadGridMailingList"
                     Width="97%"
                    AllowSorting="True" PageSize="15" AllowPaging="True"
                    runat="server" ShowStatusBar="True" GridLines="Vertical"
                    OnNeedDataSource="RadGrid1_NeedDataSource">
                    <MasterTableView CommandItemDisplay="Top">
                    </MasterTableView>
                </telerik:RadGrid>
        </div>
    <!-- content end -->
    </form>
</body>
</html>

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 17 Feb 2011, 11:18 PM
Hi Ronen,

Please set the Skin property of the RadAjaxLoadingPanel and let me know how it goes.

Best wishes,
Pavlina
the Telerik team
0
Ronen
Top achievements
Rank 1
answered on 20 Feb 2011, 09:18 AM
thanks, it's better, now i see the loading icon, but it's only shows the first time i press the button, at the following clicks , i see no loading icon,
here is the code behind:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Configuration; 
using System.Data; 
using System.Data.SqlClient; 
    
namespace test 
    public partial class testloadingpage : System.Web.UI.Page 
    
        static string mConnectionString = ConfigurationManager.ConnectionStrings["test"].ToString(); 
        static string select = ""
        protected void Page_Load(object sender, EventArgs e) 
        
            if (!IsPostBack) 
            
                select = "SELECT *  FROM test"
                RadGridMailingList.DataBind(); 
            
        
        protected void Button1_Click(object sender, EventArgs e) 
        
            select = "SELECT * from test"
            RadGridMailingList.Rebind(); 
        
        public DataTable GetDataTable(string query) 
        
            SqlConnection conn = new SqlConnection(mConnectionString); 
            SqlDataAdapter adapter = new SqlDataAdapter(); 
            adapter.SelectCommand = new SqlCommand(query, conn); 
            DataTable myDataTable = new DataTable(); 
    
            conn.Open(); 
            try 
            
                adapter.Fill(myDataTable); 
            
            finally 
            
                conn.Close(); 
            
    
            return myDataTable; 
    
        
        protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
        
            RadGridMailingList.DataSource = GetDataTable(select); 
        
    
    
0
Pavlina
Telerik team
answered on 23 Feb 2011, 03:26 PM
Hello Ronen,

I tried to replicate the problem in a simple test project but to no avail. Find the project attached to this message and see if it helps to resolve the problem.

Regards,
Pavlina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Ajax
Asked by
Ronen
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Ronen
Top achievements
Rank 1
Share this question
or