This question is locked. New answers and comments are not allowed.
(Opened a support ticket with this information and with a small application to show this behaviour)
I'm having what I think is a strange behaviour, probably is something I'm doing wrong.
As I stated in the thread title, when I click on a tree item both cellTemplate and ItemTemplate appear, so If I click on an item two lines appear, the 1st being the CellTemplate representation and the 2nd line the ItemTemplate representation. (attch: double.jpg).
This is the code that I'm using:
| <UserControl.Resources> |
| <admConverter:MulticastTreeItemImageConverter x:Name="treeItemConverter"/> |
| <admConverter:MulticastTreeItemValueConverter x:Name="treeItemValueConverter"/> |
| <DataTemplate x:Key="fieldTemplate"> |
| <StackPanel Orientation="Horizontal"> |
| <Image Source="{Binding Converter={StaticResource treeItemConverter}}" Margin="0,0,6,0" /> |
| <TextBlock Text="{Binding Name}" Margin="2"/> |
| </StackPanel> |
| </DataTemplate> |
| <DataTemplate x:Key="fieldValueTemplate"> |
| <StackPanel Orientation="Horizontal"> |
| <TextBlock Text="{Binding Converter={StaticResource treeItemValueConverter}}" Margin="2"/> |
| </StackPanel> |
| </DataTemplate> |
| <telerikControls:HierarchicalDataTemplate x:Key="messageTemplate" ItemsSource="{Binding Value.MessageFields}"> |
| <StackPanel Orientation="Horizontal"> |
| <Image Source="/Cmf.Presentation.Framework.Core.Controls;component/Images/Generic/folder-16x16.png" Margin="0,0,6,0" /> |
| <TextBlock Text="{Binding Name}" Margin="2"/> |
| </StackPanel> |
| </telerikControls:HierarchicalDataTemplate> |
| <l:TreeMessageTemplateSelector |
| x:Key="treeTemplateSelector" |
| FieldTemplate="{StaticResource fieldTemplate}" |
| MessageTemplate="{StaticResource messageTemplate}"/> |
| </UserControl.Resources> |
| <Grid x:Name="LayoutRoot"> |
| <telerikNavigation:RadTreeListView |
| Margin="3" |
| x:Name="tree" |
| ItemTemplateSelector="{StaticResource treeTemplateSelector}" |
| > |
| <telerikNavigation:RadTreeListView.Columns> |
| <telerikNavigation:RadColumn CellTemplate="{StaticResource fieldTemplate}" PropertyName="Name" Header="Name"/> |
| <telerikNavigation:RadColumn CellTemplate="{StaticResource fieldValueTemplate}" PropertyName="Value" Header="Value"/> |
| </telerikNavigation:RadTreeListView.Columns> |
| </telerikNavigation:RadTreeListView> |
| </Grid> |
I'm using HierarchicalDataTemplate to be able to show a object that has several levels.
Message X
- Field A
- Field B
- Message Y
- Field C
- Field D
Thanks ahead for all the help,
Rogério Ferreira