Does anyone have an example of how to dynamically add a web user control to a RadPanel? I have the following code, but it does not like how I am assigning the control. Does anyone have any ideas or a better way of doing this?
Dim
mainItem
As
New
RadPanelItem()
mainItem.Text =
"Parent"
mainItem.Expanded =
True
Dim
secItem
As
New
RadPanelItem()
secItem.Text =
"Child"
secItem.Expanded =
True
Dim
control
As
New
RadPanelItem()
Dim
uc
As
Control = Page.LoadControl(
"~/WebUserControls/Panels/pnl_Selection.ascx"
)
uc.ID =
"ucSelection"
control.Items.Add(uc)
secItem.Items.Add(control)
mainItem.Items.Add(secItem)
pbPnlBar.Items.Add(mainItem)