Unplanned
Last Updated: 19 Jun 2017 11:27 by ADMIN
ADMIN
Hristo
Created on: 05 Jun 2017 07:39
Category: Dock
Type: Bug Report
2
FIX. RadDock - auto-hidden window located in a tabstrip with a hidden window is deserialized as Docked
How to reproduce: check the attached project and video.

Workaround: persist the auto-hidden windows separately
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radDock1.AutoHideWindowDisplaying += RadDock1_AutoHideWindowDisplaying;

        //Wworkaround
        this.radDock1.LoadedFromXml += RadDock1_LoadedFromXml;
    }

    private void RadDock1_LoadedFromXml(object sender, EventArgs e)
    {
        string res = File.ReadAllText(@"..\..\auto-hidden.txt");
        foreach (DockWindow window in this.radDock1.GetWindows(typeof(ToolWindow), typeof(HostWindow)))
        {
            if (res.IndexOf(window.Name) != -1)
            {
                window.DockState = DockState.AutoHide;
            }
        }
    }

    private void RadDock1_AutoHideWindowDisplaying(object sender, Telerik.WinControls.UI.Docking.AutoHideWindowDisplayingEventArgs e)
    {
    }

    private void button1_Click(object sender, EventArgs e)
    {
        StringBuilder sb = new StringBuilder();
        foreach (DockWindow window in this.radDock1.GetWindows(typeof(ToolWindow), typeof(HostWindow)))
        {
            if (window.DockState == DockState.AutoHide)
            {
                sb.AppendLine(window.Name);
            }
        }

        File.WriteAllText(@"..\..\auto-hidden.txt", sb.ToString());
        this.radDock1.SaveToXml(@"..\..\layout.xml");
    }

    private void button2_Click(object sender, EventArgs e)
    {
        this.radDock1.LoadFromXml(@"..\..\layout.xml");
    }
}
0 comments