When we reorder RadPaneGroups in a RadSplitContainer the following actions are performed:
1) A new RadPaneGroup is created and the Items(RadPanes) of the original RadPaneGroup are placed inside the new one.
2) The new RadPaneGroup is placed in a ToolWindow.
3) The original RadPaneGroup is removed from the Items Collection of the RadSplitContainer.
4) When placing/docking the ToolWindow inside the SplitContainer, again, a new RadPaneGroup is created and the Items of the ToolWindow RadPaneGroup are placed inside the new RadPaneGroup.
5) The ToolWindow is closed.
Based on that, after a reorder of a RadPaneGroup the RadSplitContainer contains a copy of that group and not the original, so this line SplitContainer.Items.Remove(MyPaneGroup3);
won't remove anything because MyPaneGroup3
is no longer in the Items of the SplitContainer
I suggest, for example, modifying the remove logic to exclude RadPaneGroups based on information of their child RadPanes. This way we will not relate on a concrete instance of a RadPaneGroup(that will be lost when reordering it), but on its content ( which will be the same ). Here is a code snippet that removes the first RadPaneGroup from the SplitContainer
that has a RadPane with header "Pane Group 3":
IEnumerable<RadPaneGroup> realPanes =
.SplitContainer.Items.OfType<RadPaneGroup>().Where(pg => pg.EnumeratePanes().Any(p => p.Header.ToString().Equals(
"Pane Group 3"
Hopefully this helps and is applicable for your scenario.
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos
and start improving your app based on facts, not hunches.