Removing RadPanes

2 posts, 0 answers
  1. Nadina
    Nadina avatar
    9 posts
    Member since:
    Jul 2012

    Posted 03 Oct 2012 Link to this post

    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.
  2. George
    George avatar
    1332 posts

    Posted 08 Oct 2012 Link to this post

    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,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top