All Products
Demos
Pricing
Services
Blogs
Docs & Support
Search
Shopping cart
Login
Contact Us
Get A Free Trial
close mobile menu
Telerik Forums
/
UI for ASP.NET AJAX Forum
/
TreeView
/
Clear Global NodeTemplate
Cancel
Telerik UI for ASP.NET AJAX
Resources
Buy
Try
Feed for this thread
2 posts, 0 answers
Cliff Leighton
1 posts
Member since:
Nov 2006
Posted 12 Jul 2009
Link to this post
I have a basic global NodeTemplate defined at Design time which I would like to apply to only top level nodes. I try to set the child nodes' NodeTemplate = null on code behind in Page_Load or Page_Init but it has no effect.
To work around this issue I've removed the global template and I'm loading the top level nodes' Controls collection dynamically at runtime.
Little help anyone?
Cliff
Paul
Admin
4281 posts
Posted 16 Jul 2009
Link to this post
Hi Cliff,
I'm afraid you will have to define your template controls in code behind and add them to the needed nodes, i.e.
protected
void
Page_Load(
object
sender, EventArgs e)
{
foreach
(RadTreeNode node
in
RadTreeView1.GetAllNodes())
{
if
(node.Level == 0)
{
Label lbl =
new
Label();
lbl.Text =
"this is a text"
;
node.Controls.Add(lbl);
}
}
}
Regards,
Paul
the Telerik team
Instantly find answers to your questions on the new
Telerik Support Portal
.
Check out the tips
for optimizing your support resource searches.
Back to Top
Close