Dynamically Created Docks

4 posts, 0 answers
  1. Ryan
    Ryan avatar
    26 posts
    Member since:
    Sep 2010

    Posted 22 Feb 2011 Link to this post

    Hi all, 

    I have a problem with dynamically created docks, whereby the layout is loaded from a database for the current user. The problem is with saving the dock layout when a change is made - I am saving the current dock layout in the SaveDockLayout event handler, and I know that I have to recreate the docks on each postback (done in Page_Init), yet my problem is that Page_Init fires before the SaveDockLayout event, thus loading the user's current settings from the database and effectively resetting the dock layout back to the user's database settings before I get the chance to save the current layout.

    I have pretty much followed the structure from the "My Portal" example from the demos page, and can't figure out how it is saving the state before the docks are loaded from CurrentDockState.

    Am I missing something here?
  2. Ryan
    Ryan avatar
    26 posts
    Member since:
    Sep 2010

    Posted 22 Feb 2011 Link to this post

    OK I found a resolution to this issue ... I added session variable so that I now store the state in session, and only retrieve settings from the database on first page visit. Loading the state from session in Page_Init on subsequent visits and implementing LoadDockLayout seems to result in the new values being available in SaveDockLayout ... not sure why this is, perhaps someone can inform me?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 25 Feb 2011 Link to this post

    Hi Ryan,

    The LoadDockLayout event must be handled so that the RadDockLayout knows where each dock is positioned, index and zone. If this event is not handled and the event data is not populated with the positions and indexes, the docking layout will load the old positions.

    Greetings,
    Pero
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  5. Ryan
    Ryan avatar
    26 posts
    Member since:
    Sep 2010

    Posted 27 Feb 2011 Link to this post

    OK that makes sense, thanks for the reply Pero.
Back to Top