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

Loading from XML while RadDock is hidden

1 Answer 36 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Luc
Top achievements
Rank 1
Luc asked on 21 Mar 2014, 10:28 AM
Here is an interesting situation :

- I use a RadDock containing 2 ToolWindows, docked in a shared TabStrip.
- I change win1's dockstate to 'floating'.
- I change win2's dockstate to 'autohide'.
- I save RadDock's configuration in an XML file.
- I use RadDock.Hide().

Now, to avoid a possible flicker on the screen, I wish to load the previous XML file before showing RadDock again. After RadDock.Show(), both ToolWindows are in a 'autohide' state ! If I 'unpin' win1, it gets back to the 'floating' state. But double-clicking on its title-bar won't dock it any more.

Is there a way to safely load a XML configuration while having RadDock hidden ?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Mar 2014, 09:28 AM
Hello Luc,

Thank you for contacting Telerik Support.

I confirm that it is an issue with our RadDock's saving/loading layout, when you have two ToolWindows, docked in a shared TabStrip (one of which is in "AutoHide" state and the other window is in "Floating" state). I have logged it in our Feedback Portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - Feedback Item.

I have also updated your 
Telerik points.

Currently, the possible solution that I can suggest is to restore manually the correct state:
Dictionary<string, DockState> currentState = new Dictionary<string, DockState>();
 
public Form1()
{
    InitializeComponent();
}
//load layout
private void radButton2_Click(object sender, EventArgs e)
{
     this.radDock1.LoadFromXml("..\\..\\..\\layout1.xml");
    foreach (DockWindow window in this.radDock1.DockWindows.ToolWindows)
    {
        if (currentState.ContainsKey(window.Text))
        {
            DockState state = currentState[window.Text];
            if (window.DockState != DockState.Docked)
            {
                window.DockState = DockState.Docked;
            }
            window.DockState = state;
        }
    }
}
 
//save layout
private void radButton1_Click(object sender, EventArgs e)
{
     foreach (DockWindow window in this.radDock1.DockWindows.ToolWindows)
    {
        if (!currentState.ContainsKey(window.Text))
        {
            currentState.Add(window.Text, window.DockState);
        }
    }
    this.radDock1.SaveToXml("..\\..\\..\\layout1.xml");
}

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Desislava
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
Dock
Asked by
Luc
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or