Saving State Demo
This application demonstrates how to dynamically add dockable zones and objects to a page, how to save the state of the dockable objects into a storage medium (the Session) and how to serialize and deserialize this state into XML file.
The application is ajaxified. If you do not want to use r.a.d.ajax, just remove the RadAjaxManager and all code which refers it.
There are certain limitations which are difficult or impossible to workaround with the current version of r.a.d.dock:
- the commands of the dockable objects, such as Close, Collapse, etc. must be have AutoPostBack = true
- the dockable objects cannot be left undocked. That's why they have DockingMode = AlwaysDock
- more entries will be added
The general idea of the application is to create the dockable objects with unique IDs in the OnInit event of the page. In OnLoad you configure their state, according to the saved state in the Session. In order to set the AutoPostBack property to true you need to override the OnPreRender event. Each time a dock is closed, you need to update its state.
Greetings,
Valeri Hristov (Senior Developer, MCSD)
the Telerik team