This is a migrated thread and some comments may be shown as answers.

Need example of adding button to RadTreeView

3 Answers 165 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jerry
Top achievements
Rank 1
Jerry asked on 04 Aug 2011, 03:27 PM
I'm using the RadTreeView control in a ASP.Net user control. Each of my nodes have a ImageUrl and text.  I need to add a button to each node that triggers an event when the button is clicked.

Is there an example of this?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Aug 2011, 03:33 PM
Hello Jerry,

You can use templates which allows you to embed any context inside a RadTreeNode.
Take a look at the following documentation and demo.
Templates Overview.
TreeView / Templates.

Thanks,
Shinu.
0
Jerry
Top achievements
Rank 1
answered on 04 Aug 2011, 03:45 PM
Thanks. The problem I have is that I don't want to change our existing RadTreeView in our user control. Can I use the Template and add a button programmaticly? Would this be done via the NodeBound() event?
0
Ivan Zhekov
Telerik team
answered on 05 Aug 2011, 04:09 PM
Hello Jerry,

Yes, you could use the NodeBound event or the OnClientNodeDataBound if you want to use JS.

Should you decide to go with client events, it's better to use the OnLoad event of the RadTreeView, as adding new content to a node, while there are other loading, will slow down that loading.

Greetings,
Ivan Zhekov
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
TreeView
Asked by
Jerry
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jerry
Top achievements
Rank 1
Ivan Zhekov
Telerik team
Share this question
or