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

Full dynamic docking layout

1 Answer 77 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 12 Jul 2016, 03:31 PM

Hello,

 

I have an issue with a full dynamic docking layout. I have an asp:Panel PageContainer and I dynamically add RadDockLayouts to this container.
To these RadDockLayouts I dynamically add RadDockZones and to these RadDockZones  I dynamically add RadDocks. So far, so good.

The only thing I want to achieve is that when someone changes the order of a RadDock inside a particular RadDockZone I can somehow save the order of the RadDocks to a database. I am kind of stuck here because, amongst other things,  I do not understand the purpose of the LoadDockLayout and the SaveDockLayout events and when they happen. Do you have any suggestion(s)?

Regards
Daan

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 15 Jul 2016, 12:38 PM
Hi,

First of all, you can use a single RadDockLayout in order to persist the layout of all RadDock controls on the page. You just need to insert all dynamically created RadDockZones and dock controls in the RadDockLayout.

As for the LoadDockLayout and SaveDockLayout events, you can check the following help articles for more detailed information: The Lifecycle help article contains a schema that shows when each of the events is fired: http://docs.telerik.com/devtools/aspnet-ajax/controls/dock/structure/dock/lifecycle

Overall, LoadDockLayout is fired after the initialization of the dock controls, so that if there is any previously saved dock state (it is not the first page load), it is applied to them. SaveDockLayout is fired quite late in the page lifecycle so that any changes to the docks are saved, which will allow for them to be applied the next time a page is loaded via the LoadDockLayout event.

Finally, there is an explanation of the whole process of creating dock controls dynamically and persisting their state in the following help article: http://docs.telerik.com/devtools/aspnet-ajax/controls/dock/how-to/creating-raddock-dynamically.You can check it in action in the Dynamically Created Docks demo: http://demos.telerik.com/aspnet-ajax/dock/examples/dynamicdocks/defaultcs.aspx. What you need to do additionally is to create the RadDockZones on Page_Init in addition to the dock controls so that the dock state is correctly applied after that.

Regards,
Slav
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Dock
Asked by
Peter
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or