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

RadFilter type within Tree View

2 Answers 32 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Robert Warthen
Top achievements
Rank 1
Robert Warthen asked on 08 Oct 2010, 04:32 PM
I want to be able to enter my own controls within the Tree View instead of simply entering text in the tree view.  It would look something like the RadFilter in the end, except with different columns. It would have embedded RadComboBox and RadText controls in it.

Is there any way to do this within the telerik controls?

2 Answers, 1 is accepted

Sort by
0
Robert Warthen
Top achievements
Rank 1
answered on 08 Oct 2010, 07:13 PM
I think I have a possible solution.  I want to be able to use two different iTemplates based on what level the system is. However, when I try to run this, I can't figure out how to change the template when it does a post back. When I first create it, it is fine, but it doesn't seem to remember on post back what the template is.
0
Nikolay Tsenkov
Telerik team
answered on 13 Oct 2010, 10:02 AM
Hello Robert Warthen,

You can achieve this using the TemplateNeeded server event. It's thrown for every node separately and in the handler you can assign the proper template to it, judging by your custom criteria.

The problem you currently experience is caused by the fact that you template the nodes only once and as they are recreated on each and every round-trip to the server, they should be templated on each and every recreation.

Otherwise you are on the right direction, implementing the templates in the code-behind, implementing the ITemplate contract - this is the right way to be done!

One point about that though:
- When you assign template in the handler of TemplateNeeded, please directly add the template to the Node.NodeTemplate property, instead using the InstanciateIn method of your template.

Hope this is helpful for you!


Regards,
Nikolay Tsenkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
Robert Warthen
Top achievements
Rank 1
Answers by
Robert Warthen
Top achievements
Rank 1
Nikolay Tsenkov
Telerik team
Share this question
or