Completed
Last Updated: 22 Jul 2015 06:59 by ADMIN
ADMIN
Dimitar
Created on: 14 May 2015 14:03
Category: Dock
Type: Bug Report
0
FIX. RadDock - the current window is not properly set when the layout is loaded and the control does not have already set Active window.
To reproduce:
- Add some windows before adding loading the layout. Do not set the active window.
If mDockForms Then
    Dim df1 As New Form
    Dim df2 As New Form
    Dim df3 As New Form

    df1.BackColor = Color.Red
    df1.Text = "Docked Form 1"
    df1.Name = "DockedForm1"
    df2.BackColor = Color.White
    df2.Text = "Docked Form 2"
    df2.Name = "DockedForm2"
    df3.BackColor = Color.Blue
    df3.Text = "Docked Form 3"
    df3.Name = "DockedForm3"

    RadDock1.DockControl(df1, Docking.DockPosition.Left)
    RadDock1.DockControl(df2, Docking.DockPosition.Left)
    RadDock1.DockControl(df3, Docking.DockPosition.Left)

    df1.Show()
    df2.Show()
    df3.Show()
End If

RadDock1.LoadFromXml(xmlfile)

- Start the application, select a window and save the layout.
- Load the layout and you will notice that the last window is active.

Workaround:
Me.RadDock1.ActiveWindow = RadDock1.DockControl(df3, Docking.DockPosition.Left)

Woraround2
- Load the layout in empty RadDock and use it to retrieve the proper index: 
 Dim rd2 As New Docking.RadDock

rd2.LoadFromXml(xmlfile)

For Each c As Control In rd2.Controls
    If TypeOf c Is Docking.ToolTabStrip Then
        RadDock1.ActiveWindow = CType(RadDock1.Controls(1), Docking.ToolTabStrip).TabPanels(CType(c, Docking.ToolTabStrip).SelectedIndex)
    End If
Next
0 comments