I have a panelbar on a usercontrol. This panelbar was added with the VS Designer and thus looks great. Runtime this panelbar is filled with nodes. The top level nodes look good, because they are nodes in the panelbar that was created with the designer.
Now when I add nested panelbars runtime, they look horrible. What I do is, I enable the "EnableHostControlMode" for the top node and create a new panelbar from scratch which I add to the ContentPanel.Controls.
My question: How do I get the nested panelbars to look the same as their parents, programmaticaly?
Here's a piece of the code:
else if (mftn.Nodes.Count > 0)
{
rpgeToAdd.EnableHostControlMode = true;
rpgeToAdd.ContentPanel.Dock = DockStyle.Fill;
rpgeToAdd.ContentPanel.BackColor = System.Drawing.Color.Transparent;
Point location = new Point(0, 0);
for (int i = 0; i < mftn.Nodes.Count; i++)
{
RadPanelBar newNode = BuildPanelbarElementNode(mftn.Nodes[i]);
newNode.Size = new Size(100, 100);
newNode.Location = location;
locaction.Y += 100;
rpgeToAdd.ContentPanel.Controls.Add(newNode);
}
}
private RadPanelBar BuildPanelbarElementNode(MeterFunctionTreeNode mftn)
{
RadPanelBar panelBar = new RadPanelBar();
panelBar.ThemeClassName = "Telerik.WinControls.UI.RadPanelBar";
panelBar.ThemeName = "Telerik";
panelBar.Style = functionTree.Style;
panelBar.BackColor = System.Drawing.Color.Transparent;
panelBar.RootElement.BackColor = System.Drawing.Color.Transparent;