Dynamically created Docks and Saving State

3 posts, 2 answers
  1. Jonathan
    Jonathan avatar
    92 posts
    Member since:
    Feb 2007

    Posted 02 Jun 2008 Link to this post

    Hi,

    I think I am missing something here because I cant get this to work.  I have a statically defined DockLayout on my page with a single DockZone.  In the Page_Init event, I am dynamically creating further DockZones with Docks.  The page will allow the user to move Docks from the dynamically created DockZones to the static DockZone and save the state.  When I postback the page via a button, the static DockZone has no Docks in either the Button Click handler or the SaveDockLayout handler.  Here is my code - can anyone suggest why please?

    Thanks in advance.


    Client-side
    <telerik:RadDockLayout ID="MainDockLayout" runat="server" OnSaveDockLayout="MainDockLayout_SaveDockLayout">  
        <span class="panelHeader">Active Rules</span> 
        <telerik:RadDockZone runat="server" ID="SelectedRules" Height="200" Width="75%" CssClass="dockZoneFixed"></telerik:RadDockZone> 
        <br /> 
    </telerik:RadDockLayout> 
     

    Server-side
    RadDockZone dockZone = new RadDockZone();  
    dockZone.ID = string.Format("DockZone_{0}", parent.ID);  
    dockZone.Orientation = System.Web.UI.WebControls.Orientation.Vertical;  
    dockZone.Height = 125;  
    dockZone.MinHeight = 125;  
    dockZone.CssClass = "dockZone";  
     
    MainDockLayout.Controls.Add(dockZone);  
     
    RadDock dock = new RadDock();  
    dock.ID = string.Format("Dock_{0}", child.ID);  
    dock.DockHandle = DockHandle.None;  
    dock.Skin = "Vista";  
    dock.CssClass = "dockClass";  
    dock.OnClientInitialize = "SetDockHandle";  
     
    dockZone.Controls.Add(dock);  
     
  2. Answer
    Sophy
    Admin
    Sophy avatar
    636 posts

    Posted 02 Jun 2008 Link to this post

    Hi Jonathan,

    Please, find attached a sample page based on the scenario you describe. You can see an alert showing the number of docks in the static zone at Button Click handler and SaveDockLayout handler. How do you check what is the number of docks in the static RadDockZone on your side? I would like to ask you take a look at the sample page and let me know whether I am missing something.
    In case the attached page cannot help you solve the problem, please, open a support ticket and send us your test page which reproduces the issue so that we can take a closer look at your code. We will be glad  to help you.

    Kind regards,
    Sophy
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Answer
    Jonathan
    Jonathan avatar
    92 posts
    Member since:
    Feb 2007

    Posted 02 Jun 2008 Link to this post

    Hi Sophy,

    I apologise for wasting your time.  I realised after looking at your example (which works perfectly) that I was adding the dynamic DockZone object to the page twice - once I removed one of these it worked as expected.

    Thanks for your help.
Back to Top