locked
TreeView headers not selectable RRS feed

  • Question

  • Hi,

    I am using a TreeView to visualize data. This TreeView consists of multiple parents, each parents has its own children. What I would want to have is that only the children are selectable. How can I achieve this?

    1                        <!--Treeview for composed metadatas-->
    2    			<controls:TreeView ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Visible" ItemsSource="{Binding ComposedMetadataTypes}" x:Name="trContentMetadatas" Margin="8,63,0,60" Background="White" BorderBrush="#FFA3AEB9" HorizontalAlignment="Left" Width="280" ItemContainerStyle="{StaticResource treeViewItemStyle}" ItemsPanel="{StaticResource controlPanelItemsPanel}">
    3                            <controls:TreeView.ItemTemplate>
    4                                <treeview:HierarchicalDataTemplate ItemsSource="{Binding Metadatas}">
    5                                    <TextBlock TextTrimming="WordEllipsis" Width="205"  FontWeight="Bold" Text="{Binding Description}"></TextBlock>
    6                                    <treeview:HierarchicalDataTemplate.ItemTemplate>
    7                                        <DataTemplate>
    8                                            <TextBlock TextTrimming="WordEllipsis" Width="200" Text="{Binding ValueVisualisation}"></TextBlock>
    9                                        </DataTemplate>
    10                                   </treeview:HierarchicalDataTemplate.ItemTemplate>
    11                               </treeview:HierarchicalDataTemplate>
    12                           </controls:TreeView.ItemTemplate>
    13                           <i:Interaction.Triggers>
    14                               <i:EventTrigger EventName="SelectedItemChanged">
    15                                   <rdmvvm:CommandTriggerAction Command="{Binding ContentComposedMetadataTypeChanged}" CommandParameter="{Binding SelectedItem, ElementName=trContentMetadatas}" />
    16                               </i:EventTrigger>
    17                           </i:Interaction.Triggers>
    18                       </controls:TreeView>
    

    Thanks in advance,

     

    Thomas

      
    Thursday, May 20, 2010 4:05 AM