Dyanmic RadDock with user control loaded while dock expands

3 posts, 0 answers
  1. Karthik
    Karthik avatar
    18 posts
    Member since:
    Aug 2010

    Posted 06 Oct 2010 Link to this post

    Hi all,

    I am trying to add RadDock to my page dynamically. Inside the dock I have a RadAjaxPanel. While expanding the dock using the dock expand collapse button I am loading the user control inside the RadAjaxPanel. If I perform any postback inside the usercontrol the control disappears

    If suppose if I have a RadGrid as a usercontrol with reordering columns on client property set true It doesnot work when the control is loaded inside the RadDock.

    What should I do to solves these problems ?

    Thanks in Advance
  2. Pero
    Pero avatar
    1156 posts

    Posted 11 Oct 2010 Link to this post

    Hello Karthik,

    I believe the problem with the disappearing of the user control is caused by the fact that, the user control is created on DockCommand, but it is not recreated on subsequent postbacks. Please note that the dynamically added controls, should be recreated on every postback, and it is the developer's responsibility to make sure the controls added dynamically are recreated on postbacks. So, please make sure you add the UserControl to the dock on every trip to the server. Notice that in our MyPortal example the LoadWidget that adds user control to the dock is called on every postback.

    I created a sample project to test the second problem, but did not experience any problems. The full source code is pasted below. Could you please test it on your side, modify it so the problem can be reproduced and send it back?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <form id="form1" runat="server">
        <asp:ScriptManager ID="RadScriptManager1" runat="server">
        <script type="text/javascript">
            //Put your JavaScript code here.
            <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
                <telerik:RadDockZone ID="RadDockZone1" runat="server" MinHeight="300px" Width="300px">
                    <telerik:RadDock ID="RadDock1" runat="server" Title="RadDock-Title" Width="300px">
                            <telerik:RadGrid runat="server" ID="grdPendingOrders" AllowPaging="True" Width="100px"
                                AllowMultiRowSelection="true" PageSize="30" EnableHeaderContextMenu="true">
                                <MasterTableView TableLayout="Fixed">
                                        <telerik:GridDragDropColumn HeaderStyle-Width="18px" Visible="false" />
                                <ClientSettings AllowRowsDragDrop="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                                    <Resizing AllowColumnResize="true" />
                                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" />
                                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                <PagerStyle Mode="NumericPages" PageButtonCount="4" />

    using System;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data;
    using System.Configuration;
    using System.Web.Security;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Telerik.Web.UI;
    public partial class Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            DataTable dt = new DataTable();
            dt.Columns.Add(new DataColumn("Name"));
            dt.Columns.Add(new DataColumn("Id"));
            dt.Rows.Add("Peter", "1");
            dt.Rows.Add("John", "2");
            dt.Rows.Add("Ben", "3");
            grdPendingOrders.DataSource = dt;

    Sincerely yours,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
  4. Karthik
    Karthik avatar
    18 posts
    Member since:
    Aug 2010

    Posted 11 Oct 2010 Link to this post

    Hi Pero,

    Thanks for your suggestions. I have found the solution. The problem was due to the ajax manager settings which I specified programmatically. After removing that now it works fine.
Back to Top