Persisting old dock layout.

4 posts, 0 answers
  1. Adrian
    Adrian avatar
    7 posts
    Member since:
    Jan 2013

    Posted 29 Dec 2014 Link to this post

    I want to write a dashboard page which will be initially built dynamically but then stored in the db for re-use so that the users can then move the docks around as they wish.  However, what happens when we remove a referenced ascx control?   The stored serialised layout would contain the details of an ascx that doesn't exist anymore.. does it just ignore it, or does it fail to load the whole dock layout?
  2. Slav
    Slav avatar
    1356 posts

    Posted 05 Jan 2015 Link to this post

    Hi Adrian,

    The built-in layout persistence of RadDock does not include the content of the dock controls. If the referenced ascx control that you mentioned is loaded in a dock, the serialized dock state will not contain it by default so there should be no errors.

    This, however, means that you need to store the state of the content of the docks separately, otherwise the web user controls you are loading in the docks will not be persisted. For example, the following demo of RadDock has loading of user controls in the docks and the name of the loaded user control is kept in the Tag property of RadDock: When a dock is recreated, the correct user control is loaded via the information in the Tag property.

    If the example in the demo does not meet your requirements or if I misunderstood you, please describe your scenario in greater detail. Are you using the same approach as the one in the demo for persisting the dock state in your project? Is the referenced ascx control loaded in a dock or somewhere else?


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. terrysmith
    terrysmith avatar
    127 posts
    Member since:
    Nov 2006

    Posted 19 May 2015 in reply to Slav Link to this post

    I have a related question to this thread. I am also trying to persist a dashboard page to a database so that users can add/remove/reposition docks. Each dock will have a user control with functionality.

    Slav, the My Portal example that you mentioned as well as this one (​nd) use LoadDockLayout and SaveDockLayout. However, the documentation for built-in dock state persistence ( says that those event handlers are no longer necessary when using the new storage provider interface. 

    In my own tests I'm not getting dynamically-added controls to repopulate on the page using just the LayoutPersistenceRepositoryType  of Custom. Do I need to instead persist a list of DockStates like the first two examples and also persist any user control settings? When is the built-in persistence useful and when is it not?

    Thank you,


  5. Slav
    Slav avatar
    1356 posts

    Posted 22 May 2015 Link to this post

    Hi Terry,

    The built-in dock state persistence that is explained in the help article you linked and demonstrated in the following demo is designed to be used with declaratively created RadDock controls and not with programmatically created ones: It uses layout storage providers that handle the persistence of the dock state and not their recreation if they are initially created on the server.

    That being said, if your scenario includes dynamic creation of docks, the approach that is shown in the My Portal demo will be more appropriate.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top