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

Destroying DockPanel

1 Answer 118 Views
Dock
This is a migrated thread and some comments may be shown as answers.
JMon
Top achievements
Rank 1
JMon asked on 05 Jan 2007, 06:49 PM
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

1 Answer, 1 is accepted

Sort by
0
Chris
Telerik team
answered on 08 Jan 2007, 03:56 PM
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
Tags
Dock
Asked by
JMon
Top achievements
Rank 1
Answers by
Chris
Telerik team
Share this question
or