New to Telerik UI for WinForms? Download free 30-day trial

Loading And Saving Layouts

RadDock provides methods to save and load layouts. A layout records the size and arrangement of all DockWindows within RadDock. This saves all managed windows (ToolWindow and DocumentWindow) regardless of state (i.e. a window may be hidden or floating and still be saved). 

To Save a Layout

To save a layout, call the RadDock.SaveToXML method:




You can use the DockWindowSerializing event to exclude windows from the saved layout:

void radDock1_DockWindowSerializing(object sender, DockWindowCancelEventArgs e)
    if (e.NewWindow.Text == "Window Top")
        e.Cancel = true;

Private Sub radDock1_DockWindowSerializing(ByVal sender As Object, ByVal e As DockWindowCancelEventArgs)
    If e.NewWindow.Text = "Window Top" Then
        e.Cancel = True
    End If
End Sub

To Load a Layout

To load a layout, call the RadDock.LoadFromXML method:




Saving and Loading RadDock for WinForms Layouts In this video, you will learn how to use the simple XML serialization features of RadDock for WinForms to easily save and load RadDock layouts. (Runtime: 07:03) dock-loading-and-saving-layouts 001

See Also

In this article
Not finding the help you need? Improve this article