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

Problem with dockstate loading.

2 Answers 162 Views
Dock
This is a migrated thread and some comments may be shown as answers.
NoWay
Top achievements
Rank 1
NoWay asked on 23 Jul 2007, 02:22 PM
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.

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

Thank you in advance,

Arne van Noorloos

2 Answers, 1 is accepted

Sort by
0
NoWay
Top achievements
Rank 1
answered on 24 Jul 2007, 08:35 AM
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).
0
Petya
Telerik team
answered on 24 Jul 2007, 09:53 AM
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
Tags
Dock
Asked by
NoWay
Top achievements
Rank 1
Answers by
NoWay
Top achievements
Rank 1
Petya
Telerik team
Share this question
or