RadDock DockPositionChnanged Handler

3 posts, 1 answers
  1. Jeff
    Jeff avatar
    17 posts
    Member since:
    Sep 2012

    Posted 28 Sep 2012 Link to this post

    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. Answer
    Slav
    Admin
    Slav avatar
    1356 posts

    Posted 01 Oct 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jeff
    Jeff avatar
    17 posts
    Member since:
    Sep 2012

    Posted 01 Oct 2012 Link to this post

    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!
Back to Top