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

TemplatedNodes not applied with DataTemplateSelector

1 Answer 70 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 23 Jun 2011, 08:31 PM
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

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 29 Jun 2011, 09:34 AM
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.

Greetings,
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
Tags
TreeView
Asked by
Jeff
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or