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

RadDock DockPositionChnanged Handler

2 Answers 42 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 28 Sep 2012, 12:28 PM
Hello, all.

I'm thinking about building a dashboard that uses docks and zones similar to the "My Portal" demo.  I copied the code into a new project and saw some odd behavior.  For some reason, when a dock is first added to the page, it doesn't look like the DockPositionChanged handler fires correctly.  If I do a postback, the dock reverts to its original position.  However, after that, the dock behaves as it should; meaning, I can change zones and do a postback and all the positions and zones of already-established docks remain as they should.  Any suggestions on why a new dock wouldn't save its state even after changing zones?

2 Answers, 1 is accepted

Sort by
0
Accepted
Slav
Telerik team
answered on 01 Oct 2012, 02:49 PM
Hi Jeff,

The effect you describe is usually caused by an incorrect saving and loading of the dynamically created RadDock state. I would suggest checking the following:
  • When the dock is created for the first time on your page, add the dock to the RadDockLayout and then dock it to the RadDockZone to avoid ViewState issues on subsequent postbacks.
  • Always recreate the docks with the same ID and UniqueName.
  • Recreate the dock controls on Page_Init and call their method ApplyState to ensure that their state will be applied correctly.

The help article Dynamically Creating RadDock Controls is also quite useful when implementing such a scenario. Please follow the steps inside to resolve the problem.


Kind regards,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jeff
Top achievements
Rank 1
answered on 01 Oct 2012, 07:51 PM
Hi, Slav.

Yes, that fixed it. I wasn't adding the dock to the layout when it was being created; I just docked it to the requested zone.

Thanks again!
Tags
Dock
Asked by
Jeff
Top achievements
Rank 1
Answers by
Slav
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or