The Docking Control is not cleaning up after itself. Through the course of adding, removing panes over a duration, I noticed that the startup of my application was taking longer and longer. Problem was traced to Telerik's LoadLayout, SaveLayout process. When I inspected the persisted layout file, I found the every RadSplitContainer, and RadGroup that has ever created was still hanging around and being serialized unecessarily. (see attached image of empty generated items). When the empty generated items were removed, the performance issue was solved.
Solution: Telerik should be cleaning up these objects on the on RemoveFromParent() API of the RadPane / RadGroup.
Workaround: On the RadDocking.Close Event, perform some function similar to the following:
Solution: Telerik should be cleaning up these objects on the on RemoveFromParent() API of the RadPane / RadGroup.
Workaround: On the RadDocking.Close Event, perform some function similar to the following:
void ClearEmptyContainers() |
{ |
for (int i = DockManager.Items.Count; i > 0; i--) |
{ |
object item = DockManager.Items[i - 1]; |
if (item is RadSplitContainer) |
{ |
RadSplitContainer container = (RadSplitContainer)item; |
if (container.Items.Count == 0) |
{ |
DockManager.Items.Remove(container); |
} |
else |
{ |
//Check for empty groups |
for (int j = container.Items.Count; j > 0; j--) |
{ |
RadPaneGroup group = container.Items[j - 1] as RadPaneGroup; |
if (group.Items.Count == 0) |
{ |
group.RemoveFromParent(); |
DockManager.Items.Remove(container); |
} |
} |
} |
} |
} |
} |