We find it appropriate to explain a bit how RadDock works in terms of page life cycle. Here is a list of how a page + controls life cycle takes place:
Page.InitComplete <-- RadDockLayout.LoadDockLayout
Page.LoadViewState <-- 1
((IPostBackDataHandler)Controls).LoadPostData <-- RadDock.DockPositionChanged
Page.PreLoad <-- 5
Controls.DataChangedEvents (such as TextBox.TextChanged)
Controls.PostBackEvents (such as Button.Click) <-- 4
Controls.SaveViewState <-- 2
Page.SaveStateComplete <-- RadDockLayout.SaveDockLayout
Using the numbers above here are the important points:
1) On postback the control tree should be exactly the same as it was in 2) If it isn't you will get ViewState exceptions
2) This is the last moment where you can access the ViewState
3) The controls should be created if you want to use their PostData or PostEvents 4)
5) RadDockLayout rearranges the RadDock controls according to the information collected from the DockPositionChanged events
The last event where you can save the docks' positions is SaveDockLayout. However, you could do it in any other event, but you should ensure that the positions are not changed until SaveViewState.
LoadDockLayout is the last event where you should rebuild the docks. You could do it also in Page.Init if you want to avoid the usage of LoadDockLayout.
RadDockLayout rearranges the registered docks just after it raises LoadDockLayout, according to the supplied position information (args.Indices, args.Positions). RadDockLayout rearranges the registered docks for the second time according their client state in Page.PreLoad. This is done by registering to their DockPositionChanged events.
Please, review your code and make sure that you use RadDock in accordance with these explanations. If you are absolutely sure that your code follows them, then please, send us some simplified sample code that we could run and review plus information on what you try to achieve so that we could provide some guidance.
the Telerik team