Home Forums WinForms controls Other WinForms controls DockingWindowsInternalException when LoadLayout calling

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18583 |

    I’m trying version 2.2 of docking windows.

    Exception occured when I try to load layout

    {“Resetting all the ToolWindows in this DockLayoutManager should have brought m_rootLayout back to the ClientHost.”}

    What do I wrong ?

    private void MainForm_Load(object sender, EventArgs e)
    {
    try
    {
       
      XDocument dl = XDocument.Load(_pathDockManager );
    var r = from e1 in dl.Element(“DockingWindowsLayout”).Element(“ToolWindows”).Elements(“ToolWindow”)
    select new
    {
    IsMdi = e1.Attribute(“state”).Value == “Mdi”,
    IsVisible = e1.Attribute(“visible”).Value == “True”,
    Name = e1.Attribute(“key”).Value.Split(‘_’)[0],
    Key = e1.Attribute(“key”).Value
    };
    foreach (var window in r)
    {
    Element elem = new Element();
    elem.key = window.Key;
    elem.type = window.Name;
       
    StartWorkFormItemClicked(elem);
       
    }

      _dockManager.LoadLayout(_pathDockManager );

       
    }
    catch (Exception exc)
    {
    ExceptionCatcherLookup.Instance.processException(exc);
    }
    finally
      {  }

    }
    }

    internal void StartWorkFormItemClicked(Element element)
    {
    string type = element.type;
    try
    {
    object objToolWindowForm = null;
    if (!string.IsNullOrEmpty(element.key))
    {
    objToolWindowForm = Activator.CreateInstance(Type.GetType(type), element.key);
    }
    else
    {
    objToolWindowForm = Activator.CreateInstance(Type.GetType(type));
    }

       
      _dockManager.ToolWindows.Add(objToolWindowForm as ToolWindow);
       

    }
    catch(Exception exc)
    {
    ExceptionCatcherLookup.Instance.processException(exc);
    }
    }

    Thank you

    Imported from legacy forums. Posted by Denis (had 1773 views)

    Xceed Support
    Member
    Post count: 5658

    Hi Denis,

    Can you please post the complete stack trace of that exception so that we can investigate further?

    Imported from legacy forums. Posted by Alain [Xceed] (had 228 views)

    User (Old forums)
    Member
    Post count: 23064

    Sorry but I can’t reproduce the following error today. Maybe layout stored file was incorrect

    Imported from legacy forums. Posted by Denis (had 377 views)

    User (Old forums)
    Member
    Post count: 23064

    I had this same issue.  I tried a number of things, none of which worked.  What did work was deleting the docklayout file, running the application, and saving the docklayout file again.  The next time I tried to load the docklayout file it worked fine.

    Imported from legacy forums. Posted by Matt (had 404 views)

    Xceed Support
    Member
    Post count: 5658

    Hi,

    We are still unable to reproduce this issue on our site. We will need a sample application the reproduces the exception so that we can investigate further.

    Imported from legacy forums. Posted by Alain [Xceed] (had 2381 views)

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.