Destroying DockPanel

2 posts, 0 answers
  1. JMon
    JMon avatar
    3 posts
    Member since:
    Nov 2006

    Posted 05 Jan 2007 Link to this post

    I am trying to destroy a DockPanel rather than having its DockState changed to "hidden" when I click the "x" to close the window. The windows I close will never be viewed again.

    It is also causing problem with the "SaveXML" and "LoadXML" layout features. Windows that are "hidden",  save as hidden, but when the "LoadXML" function is run the windows change state to "docked".

    How can I destroy panels I do not want anymore?

    Thanks
  2. Chris
    Admin
    Chris avatar
    221 posts

    Posted 08 Jan 2007 Link to this post

    Hello Jack,

    The IDockable windows (DockPanel, UserDockControl, etc.) can't be destroyed while they are registered in the DockingManager. To destroy a IDockable window first use the DockingManager.Remove method and then call the DockPanel.Dispose method.

    Example:

    //register DockPanel
    DockPanel panel = new DockPanel();
    dockingManager1.SetDock(panel,
    DockPosition.Left);

    //destroy DockPanel
    dockingManager1.Remove(panel);
    panel.Dispose();

    Best wishes,
    Chris
    the telerik team
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top