Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Docking > DOCK DYNAMIC OBJECT CREATION (example)
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered DOCK DYNAMIC OBJECT CREATION (example)

Feed from this thread
  • Posted on Oct 1, 2010 (permalink)

    Hi guys,

    One of the most problematic scenarios which involves r.a.d.dock is when you need to dynamically create everything on the page and also save the state and the position of all dockable objects. Since this scenario affects the control hierarchy of the page (when the dockable objects are moved around the zones, they change parents) it is crucial to create and configure the controls in specific order. We wrote a couple of simple application which demonstrate how to create a page, with dynamically added dockable objects. The current state of the objects is saved into the session and can be serialized in XML file for further use.

    If you have any difficulties with the attached application, please do not hesitate to ask in the forum.

  • Posted on Oct 1, 2010 (permalink)

    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

    Attached files

  • Posted on Oct 1, 2010 (permalink)

    Page Flakes Demo

    This is the second application, which demonstrates the basic principles for creating PageFlakes-like applications. It does not cover completely the functionality of PageFlakes, only shows how to add dynamically objects with user controls inside to the page and save their state. It is up to you to handle the functionality of the user controls. If you need to create a production site on top of the sample, you will need to implement a new mechanism for saving the state of the page - most probably in a database.

    The demo resembles one tab from PageFlakes. If you need to add more tabs (pages) I recommend to encapsulate the current functionality in a user or custom control and then create a mechanism for adding different controls to the page and save their state.

    The application is not ajaxified, if you need to ajaxify it, you may use the same technique from SavingStateDemo.

    This application saves the positions of the objects in the dockable zones!

    Kind regards,
    Valeri Hristov (Senior Developer, MCSD)
    the Telerik team

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Docking > DOCK DYNAMIC OBJECT CREATION (example)