TemplatedNodes not applied with DataTemplateSelector

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    3 posts
    Member since:
    Nov 2010

    Posted 23 Jun 2011 Link to this post

    Hi - I have followed the Tree View styles customization from http://www.telerik.com/help/wpf/radtreeview-styles-and-templates-templated-nodes.html and it works just great.

    I've now introduced a DataTemplateSelector that picks between one of the two HierarchicalDataTemplate that I have in my control's resources.

    My problem is that once I introduce the DataTemplateSelector none of the styles or control templates that I have set up are applied. Is this a known issue? I tried putting

    template.ItemContainerStyle = frameworkElement.FindResource("TreeViewItemStyle") as Style;
    into my template selector but it did not seem to have any effect. Note that if I set ItemTemplate="{StaticResource blah}" instead of ItemTemplateSelector="{StaticResource selector" things works fine. Thanks
  2. Petar Mladenov
    Petar Mladenov avatar
    3151 posts

    Posted 29 Jun 2011 Link to this post

    Hello Jeff,

    I prepared a sample for you that uses both TemplateSelectors , HIerarchicalDataTemplates and ItemContainerStyles. Could you please examine it and modify it if needed in order to show the issue you have come up with? Thank you in advance for your cooperation.

    Petar Mladenov
    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