RadFilter type within Tree View

3 posts, 0 answers
  1. Robert Warthen
    Robert Warthen avatar
    3 posts
    Member since:
    Jan 2010

    Posted 08 Oct 2010 Link to this post

    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. Robert Warthen
    Robert Warthen avatar
    3 posts
    Member since:
    Jan 2010

    Posted 08 Oct 2010 Link to this post

    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.
  3. DevCraft R3 2016 release webinar banner
  4. Nikolay Tsenkov
    Nikolay Tsenkov avatar
    734 posts

    Posted 13 Oct 2010 Link to this post

    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!

    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
Back to Top