The page it's on is fairly complex, and I can't seem to track down what is causing this to happen. No errors are being thrown. The same issue appears to break my datepickers as well.
Any suggestions on what could be causing this or what to look for?
Thanks.
EDIT: I'm beginning to suspect is because the user control on which the gridview is located is dynamically added to the aspx page on page load. Could this be?
6 Answers, 1 is accepted
If the user control is added on post-back event you need to reload this UserControl in Page_Load when needed. You can check this example for more info:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Ajax/Examples/Common/LoadingUserControls/DefaultCS.aspx
Best wishes,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

The control is being loaded on the page_load event of the page, including on postback. Here is the test code:
On TestPage.aspx:
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site1.Master" CodeBehind="Default.aspx.cs" Inherits="TEST._Default" %> |
<%@ Register TagPrefix="UC" Src="GRID.ascx" TagName="GRID" %> |
<asp:content id="pageContent" contentplaceholderid="ContentPlaceHolder1" runat="server" > |
<asp:Panel ID="panel1" runat="server" /> |
</asp:content> |
Code behind:
public partial class _Default : System.Web.UI.Page |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
GRID g = (GRID)LoadControl("grid.ascx"); |
panel1.Controls.Add(g); |
} |
} |
Grid.ascx
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" > |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="RadGrid1"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" |
Width="75px" MinDisplayTime="1000"> |
<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' |
style="border: 0px;" /> |
</telerik:RadAjaxLoadingPanel> |
<telerik:RadGrid ID="RadGrid1" runat="server" |
Skin="Vista" AllowPaging="True" AllowSorting="true" Width="97%" DataSourceID="SessionDataSource1"> |
<PagerStyle Mode="NumericPages" /> |
<MasterTableView AutoGenerateColumns="true" Width="100%" CommandItemDisplay="Top" PageSize="5"> |
</MasterTableView> |
</telerik:RadGrid><br /> |
<asp:SqlDataSource id="SessionDataSource1" |
runat="server" selectcommand="SELECT * FROM [sites]" |
connectionstring="<%$ ConnectionStrings:TESTConnectionString2 %>"> |
</asp:SqlDataSource> |
So you see, the control being added to the page contains the gridview and all the operations on it. I think the example given is more for tab containers where the control actually changes.
Can I get the loading panel to work in this situation? Thanks.
Edit: Dynamically adding the control in this manner also breaks the date picker if it is on the control, specifically if it's shown/hidden, i.e. on an edit template in a grid view.


Thanks Neil. I did try that and it didn't seems to make a difference.
GRID g2 = (GRID)LoadControl("grid.ascx"); |
g2.ID = "g2"; |
panel1.Controls.Add(g2); |
Is this what you mean?
Thanks!

Why do you have the ajax manager in the ascx?
I have a similar setup as you. I have a master page, with a content page. Inside the content page is a user control, that actually contains other user controls with grids.
I have the AjaxManager on the master page, then use the AjaxManagerProxy for the content page and user controls.
I just make sure that the first items in the content place holder or the control are:
<asp:ScriptManagerProxy ID="AjaxScriptManagerProxy" runat="server"></asp:ScriptManagerProxy>
<telerik:RadAjaxManagerProxy runat="server" ID="AjaxManagerProxy" ></telerik:RadAjaxManagerProxy>
If you use this setup, you never actually need more than one loading panel, just setup the RadAjaxManager on the master page with a default loading panel.
Here is the master page code:
<telerik:RadScriptManager ID="MasterScriptManager" runat="server">
</telerik:RadScriptManager>
<telerik:RadAjaxManager ID="MasterAjaxManager" runat="server" EnableAJAX="true" DefaultLoadingPanelID="MasterAjaxLoadingPanel"
>
<AjaxSettings>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadStyleSheetManager ID="MasterStyleSheetManager" runat="server">
</telerik:RadStyleSheetManager>
<telerik:RadAjaxLoadingPanel ID="MasterAjaxLoadingPanel" runat="server" runat="server" Height="75px"
Width="75px" Transparency="10">
<img alt="Loading..." src='<%= originalAttribute="src" originalPath="'<%=" RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
style="border: 0px;" />
</telerik:RadAjaxLoadingPanel>
You just register your grid with the local ajaxmanagerproxy.
