You can persist the position and the Dock Zone ID but you will need the Unique Name of the dock as well. You need it because it is used as a key in the properties Positions
(which are Dictionary objects part of the DockLayoutEventArgs class) which specify where the dock should go - which zone and the position inside it:
| Protected Sub RadDockLayout1_LoadDockLayout( _
| sender As Object, _
| e As DockLayoutEventArgs) _
| Handles RadDockLayout1.LoadDockLayout
| For Each state As DockState In CurrentDockStates
| e.Positions(state.UniqueName) = state.DockZoneID
| e.Indices(state.UniqueName) = state.Index
| Next state
As you can see you could rely solely on these three values - index, Dock Zone Id and Unique Name but you will not be able to recreate the content of the docks. It is up to the developer to decide how to persist the content during postbacks. For example you could use the Tag
property of the dock. Based on that information you could create your own class with four fields (index, Dock Zone ID, Unique Name and tag) and use it to persist the state of your docks.
method does not use ViewState to return the DockState of its docks. When you call this method it iterates over the collection of docks and creates DockState objects based on them.
When you set StoreLayoutInViewState
to false you are actually telling RadDockLayout that you will take care of persisting the state of the docks. Then you need to save the state in the event handler of the SaveDockLayout
All the best,
the Telerik team
Check out Telerik Trainer
, the state of the art learning tool for Telerik products.