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

Dynamically created Docks and Saving State

2 Answers 82 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 02 Jun 2008, 12:54 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Sophy
Telerik team
answered on 02 Jun 2008, 01:33 PM
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
0
Accepted
Jonathan
Top achievements
Rank 1
answered on 02 Jun 2008, 02:13 PM
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.
Tags
Dock
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Sophy
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or