Hello,
I have an empty PanelBar in my aspx page and I want to fill it in the code behind.
I successfully fill the PanelBar with PanelItems but I don't understand how to build th HeaderTemplate and Contentemplate.
This work :
But when I try to add the headerTemplate like that :
Visual studio say that the Header is null and the header can't be instanciate.
So I try others way but nothing successfull
Is someone has any solution ?
I have an empty PanelBar in my aspx page and I want to fill it in the code behind.
I successfully fill the PanelBar with PanelItems but I don't understand how to build th HeaderTemplate and Contentemplate.
This work :
RadPanelItem myPanelItem =
new
RadPanelItem(
"First item"
)
myPanelBar.Items.Add(myPanelItem);
But when I try to add the headerTemplate like that :
RadPanelItem myPanelItem =
new
RadPanelItem(
"First item"
)
Button btn =
new
Button();
btn.Text =
"Test"
;
myPanelItem.Header.Controls.Add(btn);
myPanelBar.Items.Add(myPanelItem);
Visual studio say that the Header is null and the header can't be instanciate.
So I try others way but nothing successfull
Is someone has any solution ?