Example code for ItemTemplateSelector

2 posts, 0 answers
  1. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 19 Sep 2008 Link to this post

    Hi guys, I would like to use RadPanelBar, but with an "Add item" button at the end of each child collection. So it would look something like this:
    Programming languages (header) 
        C# 
        Java 
        C++ 
        Visual Basic 
        + Add (button) 
    Databases (header) 
        DB2 
        SQL Server 
        MySQL 
        + Add (button) 

    I was thinking along the lines of using ItemTemplateSelector to switch the template for the last item in each child collection to include both the text and the "Add" button. But I can't find any examples on how to use ItemTemplateSelector. Also, if you have a better suggestion on how to solve my problem, please let me know.

    /Henrik

  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 19 Sep 2008 Link to this post

    Hello Henrik,

    You can check this example:
    http://demos.telerik.com/silverlight/#Examples/TreeView/TemplateSelector

    It is for the RadTreeView but for RadPanelBar the code will be exactly the same.

    BTW: If you are not using databinding you can insert the button directly into the Items collection of the RadPanelBar.

    Kind regards,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
Back to Top