Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 15th, 2012  |  syntax: None  |  size: 2.10 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. I need help implementing a style into my radTreeView
  2. <Grid x:Name="LayoutRoot" Background="Salmon">
  3.  
  4.         <telerik:RadTreeView x:Name="radTreeView" Margin="8" ItemsSource="{Binding Errors}" Background="Salmon" Style="{StaticResource treeStyle}">
  5.              <Style TargetType="{x:Type telerik:RadTreeViewItem}" x:Name="treeStyle">
  6.                 <Setter Property="Focusable" Value="False"/>
  7.                 <Style.Triggers>
  8.                     <Trigger Property="IsMouseOver" Value="true">
  9.                         <Setter Property="Background" Value="{x:Null}"/>
  10.                         <Setter Property="BorderBrush" Value="{x:Null}"/>
  11.                     </Trigger>
  12.                 </Style.Triggers>
  13.             </Style>
  14.  
  15.  
  16.             <telerik:RadTreeView.ItemTemplate>
  17.                  <HierarchicalDataTemplate ItemsSource="{Binding SubItems}" >
  18.                     <Grid Background="Salmon">
  19.                         <Grid.RowDefinitions>
  20.                             <RowDefinition/>
  21.                             <RowDefinition/>
  22.  
  23.                         </Grid.RowDefinitions>
  24.                         <TextBlock Text="{Binding Description}" IsHitTestVisible="False" />
  25.  
  26.                         <ListBox Grid.Row="1" ItemsSource="{Binding Messages}" Margin="20,0,0,0" BorderBrush="#00000000" BorderThickness="0" Background="Salmon" IsHitTestVisible="False" >
  27.                             <ListBox.ItemTemplate>
  28.                                 <DataTemplate>
  29.                                     <TextBlock Text="{Binding Message}"/>
  30.                                 </DataTemplate>
  31.                             </ListBox.ItemTemplate>
  32.                         </ListBox>
  33.                     </Grid>
  34.  
  35.                 </HierarchicalDataTemplate>
  36.  
  37.  
  38.             </telerik:RadTreeView.ItemTemplate>
  39.  
  40.  
  41.         </telerik:RadTreeView>
  42.  
  43.     </Grid>
  44.  
  45. </UserControl>
  46.        
  47. <Style TargetType="TreeViewItem">
  48.       <Style.Resources>
  49.           <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FFF"/>
  50.           <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="#000"/>
  51.      </Style.Resources>  
  52. </Style>