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

[Solved] Unable to see Loading panel Image over RadGrid

1 Answer 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
venkatraman
Top achievements
Rank 1
venkatraman asked on 23 Jul 2009, 12:53 PM
Hi,

 I am trying generate a rad grid programmatically with Ajax enabled feature. Everything is fine except the Loading panel. when post back happens i am Unable to see the Loading panel image over the rad grid. Kindly help me to solve this solution ASAP.

Here is my code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!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"
<head id="Head1" runat="server"
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Height="75px" Width="75px"
            <img src="images/Loading.gif" /> 
        </telerik:RadAjaxLoadingPanel> 
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> 
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb" 
            SelectCommand="SELECT ContactName, ContactTitle, Address FROM [Customers]"></asp:AccessDataSource> 
    </div> 
    </form> 
</body> 
</html> 
 


using System; 
using System.Data; 
using System.Configuration; 
using System.Collections; 
using System.Web; 
using System.Web.Security; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Web.UI.WebControls.WebParts; 
using System.Web.UI.HtmlControls; 
using Telerik.Web.UI; 
using System.Data.OleDb; 
 
public partial class _Default : System.Web.UI.Page 
    RadGrid RadGrid2; 
 
 
    protected override void OnPreInit(EventArgs e) 
    { 
        base.OnPreInit(e); 
        if (ScriptManager.GetCurrent(this.Page) == null) 
        { 
            ScriptManager SManager = new ScriptManager(); 
            SManager.EnablePartialRendering = true
            foreach (Control c in this.Controls) 
            { 
                if (c is HtmlForm) 
                { 
                    c.Controls.AddAt(0, SManager); 
                } 
            } 
        } 
    } 
 
    protected override void OnInit(EventArgs e) 
    { 
        base.OnInit(e); 
 
        PopulateGrid(); 
    } 
 
    protected override void OnLoad(EventArgs e) 
    { 
        base.OnLoad(e); 
         
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(PlaceHolder1, RadGrid2, LoadingPanel1); 
 
    } 
 
    protected void PopulateGrid() 
    { 
        RadGrid2 = new RadGrid(); 
        RadGrid2.ID = "RadGrid1"
        RadGrid2.MasterTableView.AutoGenerateColumns = false
        RadGrid2.DataSourceID = "AccessDataSource1"
        RadGrid2.MasterTableView.AllowPaging = true
        RadGrid2.PagerStyle.Mode = GridPagerMode.NumericPages; 
        RadGrid2.AllowSorting = true
        RadGrid2.AllowFilteringByColumn = true
 
        GridBoundColumn boundColumn = new GridBoundColumn(); 
        RadGrid2.MasterTableView.Columns.Add(boundColumn); 
        boundColumn.HeaderText = "ContactName"
        boundColumn.DataField = "ContactName"
        boundColumn.UniqueName = "ContactName"
 
        boundColumn = new GridBoundColumn(); 
        RadGrid2.MasterTableView.Columns.Add(boundColumn); 
        boundColumn.HeaderText = "ContactTitle"
        boundColumn.DataField = "ContactTitle"
        boundColumn.UniqueName = "ContactTitle"
 
 
        boundColumn = new GridBoundColumn(); 
        RadGrid2.MasterTableView.Columns.Add(boundColumn); 
        boundColumn.HeaderText = "Address"
        boundColumn.DataField = "Address"
        boundColumn.UniqueName = "Address"
 
 
        GridEditCommandColumn editColumn = new GridEditCommandColumn(); 
        RadGrid2.MasterTableView.Columns.Add(editColumn); 
        editColumn.HeaderText = "Edit column"
        editColumn.UniqueName = "EditCommandColumn"
 
        GridButtonColumn buttonColumn = new GridButtonColumn(); 
        RadGrid2.MasterTableView.Columns.Add(buttonColumn); 
        buttonColumn.CommandName = "Delete"
        buttonColumn.ButtonType = GridButtonColumnType.PushButton; 
        buttonColumn.Text = "delete row"
        buttonColumn.ConfirmText = "Are you sure you would like to remove this user from the role?"
        buttonColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center; 
 
 
        PlaceHolder1.Controls.Add(RadGrid2); 
 
 
    } 
 
 
 


Thanks & Regards

Venkatraman Gururaj.



1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 23 Jul 2009, 05:33 PM
Hi Venkatraman,

Please find attached a simple runnable application that demonstrates the needed approach. Give it a try and let me know if you have other questions.

Regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
venkatraman
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or