Problem with dockstate loading.

3 posts, 0 answers
  1. NoWay
    NoWay avatar
    2 posts
    Member since:
    Feb 2007

    Posted 23 Jul 2007 Link to this post

    Hello Telerik team,

    I have a project which uses the Dock controls from RadControls "Prometheus". The idea of the project looks a lot like Windows Live (or your own example, the Portal Page). Users can have multiple pages where they can place different Dockable objects, with usercontrols loaded in the ContentContainer (such as an agenda, a phonebook, etc).

    When the user switches from CurrentPage (which will be set by a Linkbutton in an OnClick-event), I connect to our SQL Server database and get the serialized state of the docks of the clicked page. These DockState-objects seem to be ok, because the DockZoneId's are correct. The problem is, when the page is loaded, the Dockable objects aren't placed in the DockZone's from the (correct!) DockState objects, but they seem to 'copy' the places of the Dockable objects of the previous page's Docks.

    This problem only occurres when the user makes an (AJAX) PostBack, otherwise, when he hits ctrl + f5, the Dockable objects are loaded in the correct way. Can you tell me how I can fix this problem?

    This is the LoadDockLayout-event, where I set the properties of the Dockable objects. The CurrentDockStates property connects to the database in the get-function.

    1 protected void RadDockLayoutOverAll_LoadDockLayout(object sender, DockLayoutEventArgs e)  
    2 {  
    3     // CurrentDockStates is a List<DockState>, which contains the states of the Dockable objects for the CurrentPage. Those states are correct.  
    4     foreach (DockState state in CurrentDockStates)  
    5     {  
    6         if (!string.IsNullOrEmpty(state.DockZoneID))  
    7         {  
    8             e.Positions[state.UniqueName] = state.DockZoneID;  
    9             e.Indices[state.UniqueName] = state.Index;  
    10         }  
    11     }  
    12

    Thank you in advance,

    Arne van Noorloos
  2. NoWay
    NoWay avatar
    2 posts
    Member since:
    Feb 2007

    Posted 24 Jul 2007 Link to this post

    I found out that in the OnSaveDockLayout event, the states are incorrect (they are 'set back' to their previous state). When I add the same code as in my first post (the foreach-loop to set the states of the Dockable objects), at the end of the OnSaveDockLayout event the states are correct, but when the page is loaded, the Dockable objects are still placed in the wrong (previous) DockZone.

    Are the positions and indices (from the DockLayoutEventArgs parameter, called "e") being reset at the client-side or in an event which comes after the OnSaveDockLayout? The states seem to be reset too, because Dockable objects that should be collapsed are still expanded (like they were on the previous page).
  3. Petya
    Admin
    Petya avatar
    869 posts

    Posted 24 Jul 2007 Link to this post

    Hi Arnevn,

    We need to see more of the code to be able to follow its logic and determine the reason of the problem. I suggest that you send us a simple running project demonstrating the problem and we will work on it. Please, find attached instructions how to open a support ticket where you can attach files. Looking forward to your reply.

    Best wishes,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top