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

Removing RadPanes

1 Answer 505 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Nadina
Top achievements
Rank 1
Nadina asked on 03 Oct 2012, 09:19 PM
What's going on with the RadPanes collection when clicking the Close (x) button from the pane header? RadPanes are being added through code. The RadPaneGroup.Items.Count property is incremented and decremented as panes are added and closed (x). However, the RadDocking.Panes.Count property only increments as new RadPanes are added programmatically and so I don't understand the relationship here. Shouldn't the RadDocking.Panes.Count property sum the total of all panes in the RadPaneGroups?

I've tried removing closed RadPanes in the RadDocking_Close event by clearing the RadDocking.ActivePane.Content, .Header, and .DataContext properties as previous forum posts suggest, but an "object not set to a reference" error is thrown when the RadDocking.ActivePane.RemoveFromParent method is called. Hence, I can't free up resources by clearing out closed panes when a pane is closed.

Further, the RadPaneGroup.Items.Count value is decremented by 1 for each RadPane that has its pinned stated changed to "unpinned," then incremented by 1 for each RadPane that becomes "pinned." This too is strange since the RadPane's are still in the group; just unpinned.

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 08 Oct 2012, 03:32 PM
Hi Nadina,

When a pane is closed with the X button, it actually goes hidden. This means that the Pane is still alive as instance in the RadDocking control, but it's not located in the RadPaneGroup.Items collection. You could show the pane (after closing it) using the RadPane.IsHidden property. If you want to remove the Pane completely from the RadDocking control, I would suggest using the RadPane.RemoveFromParent() method.

The pinning/unpinning pane scenario is the same with above - when a pane is unpinned, it's removed from the RadPaneGroup.Items collection and placed inside an AutoHideArea.

Hope this sheds some light on the given scenario. Please do not hesitate to contact us if you have any additional questions.

All the best,
George
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Docking
Asked by
Nadina
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or