This is a migrated thread and some comments may be shown as answers.

Dynamically Created Docks

3 Answers 54 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 23 Feb 2011, 01:35 AM
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?

3 Answers, 1 is accepted

Sort by
0
Ryan
Top achievements
Rank 1
answered on 23 Feb 2011, 02:13 AM
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?
0
Pero
Telerik team
answered on 25 Feb 2011, 05:41 PM
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!
0
Ryan
Top achievements
Rank 1
answered on 27 Feb 2011, 11:07 PM
OK that makes sense, thanks for the reply Pero.
Tags
Dock
Asked by
Ryan
Top achievements
Rank 1
Answers by
Ryan
Top achievements
Rank 1
Pero
Telerik team
Share this question
or