Nested use of ItemTemplateSelector

2 posts, 0 answers
  1. Rob
    Rob avatar
    6 posts
    Member since:
    Sep 2015

    Posted 22 Jun Link to this post

    I have an object with a list of sub-objects, each of which can be a different type. These sub objects will then have a list of sub-sub-objects, which also will have different types, and I'd like them all to have different template in my tree view (to allow for different context menus, etc.)

    Essentially, I'm looking to have:

    - GlobalType (which contains a list of ISubType)

         - SubType1 (Which contains a list of ISubSubType)

              -SubSubType1

              -SubSubType2

        - SubType2 (Which contains a list of ISubSubType)

              -SubSubType3

              -SubSubType4

     

    If I have my ItemTemplateSelector for the TreeView properly defined (i.e, for each of GlobalType, SubType1, SubType2, SubSubType1, ...), will it properly set the templates for the nested items?

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1404 posts

    Posted 27 Jun Link to this post

    Hello Rob,

    Yes, you can use the ItemTemplateSelector property of RadGridView and the DataTemplates will be set to the corresponding items. For more information you can see the ItemTemplateSelector article. Check also the attached project.

    Regards,
    Martin Ivanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top