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

Sample for Dynamically created docks ot of date

2 Answers 151 Views
Dock
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 07 Apr 2008, 05:19 PM
Hello,

It seems that this sample is out of date, using scriptmanager and updatePanel, could we have a sample using RadAjaxManager ?
Moreover, I find unclear the explanation for the life process od a RadDock in the VisualStudio Documentation :

Workflow: 1). OnInit - ensure that the framework will call TrackViewState, LoadViewState and SaveViewState. We expect that all child docks will be created here. 2). TrackViewState - raise LoadDockLayout event in order to let the developer to supply the initial parents of the registered docks, because the docks could be created with different parents than needed. 2a). LoadViewState - loads and applies the dock parents from the ViewState in order to persist the dock positions between the page postbacks. 3). LoadPostData - returns true to ensure that RaisePostDataChangedEvent() 3a). Dock_DockZoneChanged - this event is raised by each dock in its LoadPostData method. We handle this event and store the pair UniqueName/NewDockZoneID in the _clientPositions Dictionary. This Dictionary will be used in #4. 4). RaisePostDataChangedEvent - sets the parents of the registered docks according their positions, set on the client. These positions are stored in the _clientPositions Dictionary. 5). OnLoad, other events, such as Click, Command, etc. If you create a dock here it will be rendered on the page, but if it is not recreated in the next OnInit, it will not persist its position, set on the client! 6). SaveViewState - stores the dock parents in the ViewState in order to persist their positions between the page postbacks. 7). Page_SaveStateComplete - raises the SaveDockLayout event to let the developer to save the state in a database or other storage medium. Note: The dock parents will be stored in the ViewState if StoreLayoutInViewState is set to true (default). Otherwise the developer should take care of the dock positions when the page is posted back.

 Does it means that the DockLayout event is overwriten using the default option of saving dock positions in ViewState ?
Are the current docks positions automatically updated after RaisePostDataChangedEvent  ?

Thanks for help.

2 Answers, 1 is accepted

Sort by
0
Sophy
Telerik team
answered on 17 Apr 2008, 02:29 PM
Hello Christian Surieux,

Please, accept our apologies for the delayed response.

Currently, we do not have an example with Dynamically Created Docks and RadAjaxManager. We will consider your suggestion of implementing such an example for one of the next updates of the control.

Regarding your questions about saving and updating docks' positions, the note which states "The dock parents will be stored in the ViewState if StoreLayoutInViewState is set to true (default).Otherwise the developer should take care of the dock positions when the page is posted back."  means the following:
  1. By default the StoreLayoutInViewState property of the RadDockLayout is set to true. If its value is not set to false, docks' states are stored in the ViewState and after a postback the docks will be on the same places as they were before the postback. However, if you want to store docks' states when navigating to other pages you will need to implement handlers for the SaveDockLayout and LoadDockLayout server-side events of the RadDockLayout control to save the state of the RadDock controls in the Session or in a database and load them afterwards (the Dynamically Created Docks online example demonstrates this).
  2. Otherwise, if the StoreLayoutInViewState is set to false, docks' states will not be automatically saved and after a postback the docks will be rendered with their initial states. In this case to store docks' states the developer should take care of them in a way similar to the one demonstrated in the Dynamically Created Docks online example.  

RaisePostDataChangedEvent sets the parents of the registered docks according their
positions, set on the client and after that the RadDockLayout will reorganize the docks according this information.

Kind regards,
Sophy
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Accepted
CSurieux
Top achievements
Rank 2
answered on 17 Apr 2008, 02:42 PM
No problem, thanks for clear answer.
I suppose you were busy with version 2008 Q1, now  ....I AM busy with it.

CS
Tags
Dock
Asked by
CSurieux
Top achievements
Rank 2
Answers by
Sophy
Telerik team
CSurieux
Top achievements
Rank 2
Share this question
or