New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

LoadDockLayout

The LoadDockLayout event occurs when it is appropriate for the application to load the state of all its RadDock controls when that state has been previously saved by a SaveDockLayout event handler.

The LoadDockLayout event handler receives two arguments:

  1. The RadDockLayout control that is responsible for managing the layout of RadDockZone and RadDock controls. This argument is of type object, but can be cast to the RadDockLayout type.

  2. A DockLayoutEventArgs object. This object provides access to layout information in two properties:

    • Indices is a Dictionary that stores the Index property of all RadDock controls, accessed through the UniqueName property of the RadDock control.
    • Positions is a Dictionary that stores the DockZoneID property of all RadDock controls, accessed through the UniqueName property of the RadDock control.

If the application has not explicitly set the UniqueName property of the RadDock controls, the Indices and Positions properties of the DockLayoutEventArgs object are indexed by the server-side ID of the RadDock controls.

The LoadDockLayout should set the Indices and Positions properties of the DockLayoutEventArgs argument from the values that were saved by the SaveDockLayout event handler:

C#
protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)
{
    HttpCookie dockState = Page.Request.Cookies.Get("MyApplicationDockStates");
    if (dockState != null)
    {
        string serializedList = dockState.Value;
        if (serializedList != null)
        {
            string[] states = serializedList.Split('|');
            for (int i = 0; i < states.Length; i++)
            {
                DockState state = DockState.Deserialize(states[i]);
                e.Positions[state.UniqueName] = state.DockZoneID;
                e.Indices[state.UniqueName] = state.Index;
            }
        }
    }
}

If other properties than the position and dock zone can change for the RadDock controls, the application should call the ApplyState method of the RadDock controls, passing in the saved DockState object. This can be done either in the LoadDockLayout event handler, or in the Page_Init event handler.

See Also

In this article
See Also
Not finding the help you need?
Contact Support