Removing Hover effect

5 posts, 0 answers
  1. Michele
    Michele avatar
    426 posts
    Member since:
    Jun 2009

    Posted 03 Dec 2009 Link to this post

    Hello,
    how do I remove the hover effect in a treeview?
    Thanks in advance
    Paolo
  2. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 04 Dec 2009 Link to this post

    Hi Paolo,

    Please take a look at the following article:

    http://www.telerik.com/support/kb/silverlight/treeview/how-to-style-radtreeviewitem.aspx

    Here you can find out how to customize the appearance of RadTreeViewItems.
    In order to remove the Hover effect from the items you just have to remove the MouseOver VisualState:
    <VisualState x:Name="MouseOver">
                                <Storyboard>
                                    <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                        Storyboard.TargetName="MouseOverVisual" To="0.9"
                                        Duration="0:0:0.1" />
                                </Storyboard>
                            </VisualState>
    I hope that this will help you.
    Please let us know if you have any other questions or need some more help.

    All the best,
    Boryana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Michele
    Michele avatar
    426 posts
    Member since:
    Jun 2009

    Posted 11 Jan 2010 Link to this post

    Hello Boryana,
    I've tried to do as posted in the KB... I've still got some problems with the treeviewitem hover (I can't remove this!)
    How I can remove this?? Here's my xaml file....
    Thanks

    <UserControl  
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
        xmlns:IFDett="clr-namespace:IFWebLight.Disallineamenti.Dettaglio" 
        xmlns:telNav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:Telerik_Windows_Controls_TreeView="clr-namespace:Telerik.Windows.Controls.TreeView;assembly=Telerik.Windows.Controls.Navigation" xmlns:Telerik_Windows_Controls_Animation="clr-namespace:Telerik.Windows.Controls.Animation;assembly=Telerik.Windows.Controls" xmlns:Telerik_Windows_Controls_Animation1="clr-namespace:Telerik.Windows.Controls.Animation;assembly=Telerik.Windows.Controls.Navigation" xmlns:Telerik_Windows_Controls_DragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls" x:Class="IFWebLight.Disallineamenti.Dettaglio.DettaglioDisall" 
        Loaded="UserControl_Loaded" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">  
        <UserControl.Resources> 
            <LinearGradientBrush x:Key="NavigationMouseoverFill" EndPoint="0.5,1" StartPoint="0.5,0">  
                <!--<GradientStop Color="#FFFDFDF1" Offset="0"/>  
                <GradientStop Color="#FFFDEDBD" Offset="1"/>  
                <GradientStop Color="#FFFDF2CC" Offset="0.5"/>  
                <GradientStop Color="#FFFDE6A5" Offset="0.51"/>--> 
            </LinearGradientBrush> 
            <LinearGradientBrush x:Key="NavigationMouseoverStroke" EndPoint="0.5,1" StartPoint="0.5,0">  
                <!--<GradientStop Color="#FFE8E0C2" Offset="0"/>  
                <GradientStop Color="#FFE6E2D0" Offset="1"/>--> 
            </LinearGradientBrush> 
            <LinearGradientBrush x:Key="RadTreeViewSelectUnFocusFill" EndPoint="0,1">  
                <GradientStop Color="#FFf8f6f9" Offset="0"/>  
                <GradientStop Color="#FFf0f0f0" Offset="1"/>  
            </LinearGradientBrush> 
            <SolidColorBrush x:Key="RadTreeViewSelectUnFocus" Color="#FFdbdbdb"/>  
            <SolidColorBrush x:Key="NavigationSelectFill" Color="Red" > 
                  
            </SolidColorBrush> 
            <!--<LinearGradientBrush x:Key="NavigationSelectFill" EndPoint="0.5,1" StartPoint="0.5,0">  
                <GradientStop Color="#FFFEFDF1" Offset="0"/>  
                <GradientStop Color="#FFFEE699" Offset="1"/>  
                <GradientStop Color="#FFFEEBAA" Offset="0.5"/>  
                <GradientStop Color="#FFFED560" Offset="0.51"/>  
            </LinearGradientBrush>--> 
            <LinearGradientBrush x:Key="NavigationSelectStroke" EndPoint="0.5,1" StartPoint="0.5,0">  
                <GradientStop Color="#FFDBCF9C" Offset="0"/>  
                <GradientStop Color="#FFD8D1B3" Offset="1"/>  
            </LinearGradientBrush> 
            <SolidColorBrush x:Key="LineBrush" Color="#FFCCCCCC"/>  
            <telerik:Office_BlackTheme x:Key="Theme"/>  
            <SolidColorBrush x:Key="FocusBrushBlack" Color="#FF000000"/>  
            <ControlTemplate x:Key="TreeViewItemDefaultTemplate" TargetType="telNav:RadTreeViewItem">  
                <Grid x:Name="RootElement">  
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="Auto"/>  
                        <RowDefinition/> 
                    </Grid.RowDefinitions> 
                    <VisualStateManager.VisualStateGroups> 
                        <VisualStateGroup x:Name="EditStates">  
                            <VisualState x:Name="Display"/>  
                            <VisualState x:Name="Edit">  
                                <Storyboard> 
                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="EditHeaderElement" Storyboard.TargetProperty="Visibility">  
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>  
                                    </ObjectAnimationUsingKeyFrames> 
                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Header" Storyboard.TargetProperty="Visibility">  
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>  
                                    </ObjectAnimationUsingKeyFrames> 
                                </Storyboard> 
                            </VisualState> 
                        </VisualStateGroup> 
                        <VisualStateGroup x:Name="CommonStates">  
                            <VisualState x:Name="Normal"/>  
                            <VisualState x:Name="Disabled">  
                                <Storyboard> 
                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility">  
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>  
                                    </ObjectAnimationUsingKeyFrames> 
                                    <DoubleAnimation Duration="0:0:0.0" Storyboard.TargetName="Header" Storyboard.TargetProperty="Opacity" To="0.35"/>  
                                    <DoubleAnimation Duration="0:0:0.0" Storyboard.TargetName="Image" Storyboard.TargetProperty="Opacity" To="0.35"/>  
                                </Storyboard> 
                            </VisualState> 
                            <!--<VisualState x:Name="MouseOver"/>--> 
                        </VisualStateGroup> 
                        <VisualStateGroup x:Name="SelectionStates">  
                            <VisualState x:Name="Unselected"/>  
                            <VisualState x:Name="Selected"/>  
                                <!--<Storyboard> 
                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="SelectionVisual" Storyboard.TargetProperty="Visibility">  
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>  
                                    </ObjectAnimationUsingKeyFrames> 
                                </Storyboard> 
                            </VisualState>--> 
                            <VisualState x:Name="SelectedUnfocused">  
                                <Storyboard> 
                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="SelectionUnfocusedVisual" Storyboard.TargetProperty="Visibility">  
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>  
                                    </ObjectAnimationUsingKeyFrames> 
                                </Storyboard> 
                            </VisualState> 
                        </VisualStateGroup> 
                        <VisualStateGroup x:Name="LoadingOnDemandStates">  
                            <VisualState x:Name="LoadingOnDemand">  
                                <Storyboard> 
                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LoadingVisual" Storyboard.TargetProperty="Visibility">  
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>  
                                    </ObjectAnimationUsingKeyFrames> 
                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Expander" Storyboard.TargetProperty="Visibility">  
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>  
                                    </ObjectAnimationUsingKeyFrames> 
                                    <DoubleAnimation Duration="0:0:1" RepeatBehavior="Forever" Storyboard.TargetName="LoadingVisualAngleTransform" Storyboard.TargetProperty="Angle" From="0" To="359"/>  
                                </Storyboard> 
                            </VisualState> 
                            <VisualState x:Name="LoadingOnDemandReverse"/>  
                        </VisualStateGroup> 
                        <VisualStateGroup x:Name="FocusStates">  
                            <VisualState x:Name="Focused">  
                                <!--<Storyboard> 
                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">  
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>  
                                    </ObjectAnimationUsingKeyFrames> 
                                </Storyboard>--> 
                            </VisualState> 
                            <VisualState x:Name="Unfocused"/>  
                        </VisualStateGroup> 
                        <VisualStateGroup x:Name="ExpandStates">  
                            <VisualState x:Name="Expanded"/>  
                            <VisualState x:Name="Collapsed"/>  
                        </VisualStateGroup> 
                    </VisualStateManager.VisualStateGroups> 
                    <Grid x:Name="HeaderRow" MinHeight="{TemplateBinding MinHeight}" Background="Transparent">  
                        <Grid.ColumnDefinitions> 
                            <ColumnDefinition Width="Auto"/>  
                            <ColumnDefinition Width="Auto"/>  
                            <ColumnDefinition Width="Auto"/>  
                            <ColumnDefinition Width="Auto"/>  
                            <ColumnDefinition Width="Auto"/>  
                            <ColumnDefinition Width="*"/>  
                        </Grid.ColumnDefinitions> 
                        <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" RadiusX="2" RadiusY="2" Grid.Column="2" Grid.ColumnSpan="6"/>  
                        <Rectangle x:Name="MouseOverVisual" Fill="{StaticResource NavigationMouseoverFill}" Stroke="{StaticResource NavigationMouseoverStroke}" RadiusX="2" RadiusY="2" Opacity="0" Grid.Column="2" Grid.ColumnSpan="6"/>  
                        <Rectangle x:Name="SelectionUnfocusedVisual" Fill="{StaticResource RadTreeViewSelectUnFocusFill}" Stroke="{TemplateBinding Background}"  RadiusX="2" RadiusY="2" IsHitTestVisible="False" Visibility="Collapsed" Grid.Column="2" Grid.ColumnSpan="6"/>  
                        <Rectangle x:Name="SelectionVisual" Fill="{StaticResource NavigationSelectFill}" Stroke="{StaticResource NavigationSelectStroke}" RadiusX="2" RadiusY="2" IsHitTestVisible="False" Visibility="Collapsed" Grid.Column="2" Grid.ColumnSpan="6"/>  
                        <StackPanel x:Name="IndentContainer" Orientation="Horizontal">  
                            <Rectangle x:Name="IndentFirstVerticalLine" Stroke="{StaticResource LineBrush}" VerticalAlignment="Top" Width="1" Visibility="Collapsed">  
                                <Rectangle.Clip> 
                                    <RectangleGeometry Rect="0,0,1,10000"/>  
                                </Rectangle.Clip> 
                            </Rectangle> 
                        </StackPanel> 
                        <Grid x:Name="ListRootContainer" HorizontalAlignment="Center" MinWidth="20" Grid.Column="1">  
                            <Rectangle x:Name="HorizontalLine" Stroke="{StaticResource LineBrush}" Height="1" HorizontalAlignment="Right" VerticalAlignment="Center">  
                                <Rectangle.Clip> 
                                    <RectangleGeometry Rect="0,0,10000,1"/>  
                                </Rectangle.Clip> 
                            </Rectangle> 
                            <Rectangle x:Name="VerticalLine" Stroke="{StaticResource LineBrush}" HorizontalAlignment="Center" VerticalAlignment="Top" Width="1">  
                                <Rectangle.Clip> 
                                    <RectangleGeometry Rect="0,0,1,10000"/>  
                                </Rectangle.Clip> 
                            </Rectangle> 
                            <ToggleButton x:Name="Expander" Background="{TemplateBinding Background}" IsTabStop="False"/>  
                            <Grid x:Name="LoadingVisual" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed">  
                                <Grid.RenderTransform> 
                                    <TransformGroup> 
                                        <RotateTransform x:Name="LoadingVisualAngleTransform" Angle="0" CenterX="0.5" CenterY="0.5"/>  
                                    </TransformGroup> 
                                </Grid.RenderTransform> 
                                <Path Stretch="Fill" Stroke="{TemplateBinding Foreground}" StrokeStartLineCap="Round" StrokeThickness="1" Height="10" Width="10" Data="M1,0 A1,1,90,1,1,0,-1"/>  
                                <Path Fill="{TemplateBinding Foreground}" Stretch="Fill" StrokeThickness="1" Height="4" HorizontalAlignment="Left" Margin="5,-1.5,0,0" VerticalAlignment="Top" Width="4" Data="M0,-1.1 L0.1,-1 L0,-0.9"/>  
                            </Grid> 
                        </Grid> 
                        <CheckBox x:Name="CheckBoxElement" IsTabStop="False" Margin="5,0,0,0" VerticalAlignment="Center" Visibility="Collapsed" Grid.Column="2" telerik:StyleManager.Theme="{StaticResource Theme}"/>  
                        <RadioButton x:Name="RadioButtonElement" IsTabStop="False" Margin="5,0,0,0" VerticalAlignment="Center" Visibility="Collapsed" Grid.Column="2" telerik:StyleManager.Theme="{StaticResource Theme}"/>  
                        <Image x:Name="Image" HorizontalAlignment="Center" Margin="2" MaxHeight="16" MaxWidth="16" VerticalAlignment="Center" Grid.Column="3" Source="{TemplateBinding DefaultImageSrc}"/>  
                        <Rectangle x:Name="FocusVisual" Stroke="{StaticResource FocusBrushBlack}" StrokeDashArray="1 2" StrokeThickness="1" RadiusX="3" RadiusY="3" IsHitTestVisible="False" Visibility="Collapsed" Grid.Column="2" Grid.ColumnSpan="6"/>  
                        <Grid Grid.Column="4" Grid.ColumnSpan="2">  
                            <ContentPresenter x:Name="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"/>  
                            <ContentPresenter x:Name="EditHeaderElement" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/>  
                        </Grid> 
                        <Rectangle x:Name="DisabledVisual" IsHitTestVisible="true" Visibility="Collapsed" Grid.Column="2" Grid.ColumnSpan="3"/>  
                    </Grid> 
                    <ItemsPresenter x:Name="ItemsHost" Visibility="Collapsed" Grid.Row="1"/>  
                </Grid> 
            </ControlTemplate> 
            <Style x:Key="RadTreeViewItemStyle1" TargetType="telNav:RadTreeViewItem">  
                <Setter Property="HorizontalContentAlignment" Value="Left"/>  
                <Setter Property="VerticalContentAlignment" Value="Center"/>  
                <Setter Property="CheckState" Value="Off"/>  
                <Setter Property="BorderThickness" Value="1"/>  
                <Setter Property="Padding" Value="1 0 5 0"/>  
                <Setter Property="IsDropAllowed" Value="True"/>  
                <Setter Property="ItemsOptionListType" Value="Default"/>  
                <Setter Property="IsEnabled" Value="True"/>  
                <Setter Property="MinHeight" Value="24"/>  
                <Setter Property="Template" Value="{StaticResource TreeViewItemDefaultTemplate}"/>  
                <Setter Property="ItemsPanel">  
                    <Setter.Value> 
                        <ItemsPanelTemplate> 
                            <Telerik_Windows_Controls_TreeView:TreeViewPanel VerticalAlignment="Bottom"/>  
                        </ItemsPanelTemplate> 
                    </Setter.Value> 
                </Setter> 
            </Style> 
            <SolidColorBrush x:Key="DragBetweenItemsFeedback_BackgroundBrush" Color="#FFFA8C3B"/>  
            <SolidColorBrush x:Key="DisabledBrush" Color="#99FFFFFF"/>  
            <Style x:Key="RadTreeViewStyle1" TargetType="telNav:RadTreeView">  
                <Setter Property="Telerik_Windows_Controls_Animation:AnimationManager.AnimationSelector">  
                    <Setter.Value> 
                        <Telerik_Windows_Controls_Animation:AnimationSelector> 
                            <Telerik_Windows_Controls_Animation1:TreeViewExpandCollapseAnimation AnimationName="Expand" Direction="In"/>  
                            <Telerik_Windows_Controls_Animation1:TreeViewExpandCollapseAnimation AnimationName="Collapse" Direction="Out"/>  
                        </Telerik_Windows_Controls_Animation:AnimationSelector> 
                    </Setter.Value> 
                </Setter> 
                <Setter Property="IsDragTooltipEnabled" Value="True"/>  
                <Setter Property="IsEnabled" Value="True"/>  
                <Setter Property="IsDropPreviewLineEnabled" Value="True"/>  
                <Setter Property="IsRootLinesEnabled" Value="True"/>  
                <Setter Property="IsExpandOnDblClickEnabled" Value="True"/>  
                <Setter Property="IsDragPreviewEnabled" Value="True"/>  
                <Setter Property="SelectionMode" Value="Single"/>  
                <Setter Property="ItemsIndent" Value="20"/>  
                <Setter Property="ItemsPanel">  
                    <Setter.Value> 
                        <ItemsPanelTemplate> 
                            <Telerik_Windows_Controls_TreeView:TreeViewPanel/> 
                        </ItemsPanelTemplate> 
                    </Setter.Value> 
                </Setter> 
                <Setter Property="Telerik_Windows_Controls_DragDrop:RadDragAndDropManager.AllowDrop" Value="True"/>  
                <Setter Property="ItemEditTemplate">  
                    <Setter.Value> 
                        <DataTemplate> 
                            <TextBox/> 
                        </DataTemplate> 
                    </Setter.Value> 
                </Setter> 
                <Setter Property="ExpanderStyle">  
                    <Setter.Value> 
                        <Style TargetType="ToggleButton">  
                            <Setter Property="IsEnabled" Value="True"/>  
                            <Setter Property="BorderBrush" Value="#FF262626"/>  
                            <Setter Property="IsTabStop" Value="False"/>  
                            <Setter Property="Cursor" Value="Hand"/>  
                            <Setter Property="Template">  
                                <Setter.Value> 
                                    <ControlTemplate TargetType="ToggleButton">  
                                        <Grid Margin="5,0,0,0">  
                                            <VisualStateManager.VisualStateGroups> 
                                                <VisualStateGroup x:Name="CommonStates">  
                                                    <VisualState x:Name="Normal"/>  
                                                    <VisualState x:Name="MouseOver">  
                                                        <!--<Storyboard> 
                                                            <DoubleAnimation Duration="0:0:0.05" Storyboard.TargetName="ExpandedVisualOver" Storyboard.TargetProperty="Opacity" To="1"/>  
                                                            <DoubleAnimation Duration="0:0:0.05" Storyboard.TargetName="CollapsedVisualOver" Storyboard.TargetProperty="Opacity" To="1"/>  
                                                        </Storyboard>--> 
                                                    </VisualState> 
                                                </VisualStateGroup> 
                                                <VisualStateGroup x:Name="CheckStates">  
                                                    <VisualState x:Name="Checked">  
                                                        <Storyboard> 
                                                            <DoubleAnimation Duration="0:0:0.05" Storyboard.TargetName="ExpandedStates" Storyboard.TargetProperty="Opacity" To="1"/>  
                                                            <DoubleAnimation Duration="0:0:0.05" Storyboard.TargetName="CollapsedStates" Storyboard.TargetProperty="Opacity" To="0"/>  
                                                        </Storyboard> 
                                                    </VisualState> 
                                                    <VisualState x:Name="Unchecked">  
                                                        <Storyboard> 
                                                            <DoubleAnimation Duration="0:0:0.05" Storyboard.TargetName="ExpandedStates" Storyboard.TargetProperty="Opacity" To="0"/>  
                                                            <DoubleAnimation Duration="0:0:0.05" Storyboard.TargetName="CollapsedStates" Storyboard.TargetProperty="Opacity" To="1"/>  
                                                        </Storyboard> 
                                                    </VisualState> 
                                                </VisualStateGroup> 
                                            </VisualStateManager.VisualStateGroups> 
                                            <Grid x:Name="CollapsedStates">  
                                                <Path x:Name="CollapsedVisual" Fill="#FF989898" Stretch="Fill" Stroke="#FF989898" Height="9" HorizontalAlignment="Left" Margin="3,1,0,0" VerticalAlignment="Center" Width="6" RenderTransformOrigin="0.5,1" Data="M0.5,0.5 L5.2,5.4 L5.2,5.4 L0.5,10.5 z"/>  
                                                <Path x:Name="CollapsedVisualOver" Fill="#FFFDBA64" Stretch="Fill" Stroke="#FFFDBA64" Height="9" HorizontalAlignment="Left" Margin="3,1,0,0" VerticalAlignment="Center" Width="6" Opacity="0" RenderTransformOrigin="0.5,1" Data="M0.5,0.5 L5.2,5.4 L5.2,5.4 L0.5,10.5 z"/>  
                                            </Grid> 
                                            <Grid x:Name="ExpandedStates" Opacity="0">  
                                                <Path x:Name="ExpandedVisual" Fill="#595959" Stretch="Fill" Stroke="{TemplateBinding BorderBrush}" Height="7" HorizontalAlignment="Left" Margin="2,1,0,0" VerticalAlignment="Center" Width="7" Data="M3.27,3.75 L6.5,0.5 L6.5,6.5 L0.5,6.5 z"/>  
                                                <Path x:Name="ExpandedVisualOver" Fill="#595959" Stretch="Fill" Stroke="{TemplateBinding BorderBrush}" Height="7" HorizontalAlignment="Left" Margin="2,1,0,0" VerticalAlignment="Center" Width="7" Opacity="0" Data="M3.27,3.75 L6.5,0.5 L6.5,6.5 L0.5,6.5 z"/>  
                                            </Grid> 
                                        </Grid> 
                                    </ControlTemplate> 
                                </Setter.Value> 
                            </Setter> 
                        </Style> 
                    </Setter.Value> 
                </Setter> 
                <Setter Property="Template">  
                    <Setter.Value> 
                        <ControlTemplate TargetType="telNav:RadTreeView">  
                            <Grid x:Name="RootElement">  
                                <VisualStateManager.VisualStateGroups> 
                                    <VisualStateGroup x:Name="DropStates">  
                                        <VisualState x:Name="DropImpossible"/>  
                                        <VisualState x:Name="DropPossible"/>  
                                        <VisualState x:Name="DropRootPossible">  
                                            <Storyboard> 
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ScrollViewer" Storyboard.TargetProperty="Background">  
                                                    <DiscreteObjectKeyFrame KeyTime="0">  
                                                        <DiscreteObjectKeyFrame.Value> 
                                                            <SolidColorBrush Color="#7fFCD590"/>  
                                                        </DiscreteObjectKeyFrame.Value> 
                                                    </DiscreteObjectKeyFrame> 
                                                </ObjectAnimationUsingKeyFrames> 
                                            </Storyboard> 
                                        </VisualState> 
                                    </VisualStateGroup> 
                                </VisualStateManager.VisualStateGroups> 
                                <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">  
                                    <Grid> 
                                        <ScrollViewer x:Name="ScrollViewer" BorderThickness="0" IsTabStop="False" Padding="{TemplateBinding Padding}" telerik:StyleManager.Theme="{StaticResource Theme}" telerik:ScrollViewerExtensions.EnableMouseWheel="True">  
                                            <ItemsPresenter/> 
                                        </ScrollViewer> 
                                        <Grid x:Name="DragBetweenItemsFeedback" Height="8" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" VerticalAlignment="Top" IsHitTestVisible="False" Visibility="Collapsed">  
                                            <Grid.ColumnDefinitions> 
                                                <ColumnDefinition Width="8"/>  
                                                <ColumnDefinition/> 
                                            </Grid.ColumnDefinitions> 
                                            <Ellipse Stroke="{StaticResource DragBetweenItemsFeedback_BackgroundBrush}" StrokeThickness="2" Height="8" HorizontalAlignment="Left" VerticalAlignment="Center" Width="8"/>  
                                            <Rectangle Fill="{StaticResource DragBetweenItemsFeedback_BackgroundBrush}" RadiusX="2" RadiusY="2" Height="2" Margin="-2,3,0,0" VerticalAlignment="Top" Grid.Column="1"/>  
                                        </Grid> 
                                    </Grid> 
                                </Border> 
                                <Rectangle x:Name="DisabledVisual" Fill="{StaticResource DisabledBrush}" IsHitTestVisible="true" Visibility="Collapsed"/>  
                            </Grid> 
                        </ControlTemplate> 
                    </Setter.Value> 
                </Setter> 
            </Style> 
        </UserControl.Resources> 
        <ScrollViewer x:Name="scViewer" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0,0">  
            <StackPanel> 
                <Grid x:Name="LayoutRoot" ScrollViewer.VerticalScrollBarVisibility="Auto">  
                    <Grid.Background> 
                        <ImageBrush ImageSource="./Images/background.jpg"/>  
                    </Grid.Background> 
                
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="100"/>  
                        <RowDefinition Height="Auto"/>  
                    </Grid.RowDefinitions> 
                    <Grid Grid.Row="0">  
                        <Grid.ColumnDefinitions> 
                            <ColumnDefinition Width="Auto"/>  
                            <ColumnDefinition Width="Auto"/>  
                        </Grid.ColumnDefinitions> 
                        <Grid.RowDefinitions> 
                            <RowDefinition Height="25"/>  
                            <RowDefinition Height="25"/>  
                            <RowDefinition Height="25"/>  
                            <RowDefinition Height="25"/>  
                        </Grid.RowDefinitions> 
                        <TextBlock Grid.Row="0" Grid.Column="0" Text="NDG" FontSize="20" /> 
                        <TextBlock Grid.Row="0" Grid.Column="1" Margin="5,0,0,0" x:Name="txtNDG" FontSize="20"/>  
                        <TextBlock Grid.Row="1" Grid.Column="0" Text="Profilo" FontSize="20" /> 
                        <TextBlock Grid.Row="1" Grid.Column="1" Margin="5,0,0,0" x:Name="txtProfilo" FontSize="20"/>  
                        <TextBlock Grid.Row="2" Grid.Column="0" Text="Data Sottoscrizione" FontSize="20" /> 
                        <TextBlock Grid.Row="2" Grid.Column="1" Margin="5,0,0,0" x:Name="txtData" FontSize="20"/>  
                        <TextBlock Grid.Row="3" Grid.Column="0" Text="Disallineamento" FontSize="20" /> 
                        <TextBlock Grid.Row="3" Grid.Column="1" Margin="5,0,0,0" x:Name="txtDisallineamento" FontSize="20"/>  
                    </Grid> 
                    <Grid x:Name="gvContent" Grid.Row="1" Grid.ColumnSpan="2">  
                        <Grid.RowDefinitions> 
                            <RowDefinition Height="*"/>  
                            <RowDefinition Height="*"/>  
                            <RowDefinition Height="*"/>  
                        </Grid.RowDefinitions> 
                        <Grid.ColumnDefinitions> 
                            <ColumnDefinition/> 
                            <ColumnDefinition/> 
                        </Grid.ColumnDefinitions> 
                        <telNav:RadTreeView Background="{Binding}" Grid.Row="0" Grid.Column="0"  Foreground="Black" x:Name="treeViewCC" IsSingleExpandPath="True"  Style="{StaticResource RadTreeViewStyle1}"  > 
                            <telNav:RadTreeViewItem Header="AAA" Style="{StaticResource RadTreeViewItemStyle1}">  
                                <telNav:RadTreeViewItem.HeaderTemplate> 
                                    <DataTemplate> 
                                        <TextBlock FontSize="20" Text="AAA title" FontWeight="Bold"  /> 
                                    </DataTemplate> 
                                </telNav:RadTreeViewItem.HeaderTemplate> 
                                <IFDett:CC  x:Name="ucCC"/>          
                            </telNav:RadTreeViewItem> 
                        </telNav:RadTreeView> 
                        <telNav:RadTreeView Background="{Binding}"  Grid.Row="0" Grid.Column="1" Foreground="Black" x:Name="treeViewPCT">  
                            <telNav:RadTreeViewItem Header="BBB" Style="{StaticResource RadTreeViewItemStyle1}">  
                                <telNav:RadTreeViewItem.HeaderTemplate> 
                                    <DataTemplate> 
                                        <TextBlock FontSize="20" Text="BBB title" FontWeight="Bold"  /> 
                                    </DataTemplate> 
                                </telNav:RadTreeViewItem.HeaderTemplate> 
                                <IFDett:PCT x:Name="ucPCT"/>  
                            </telNav:RadTreeViewItem> 
                        </telNav:RadTreeView> 
                        <telNav:RadTreeView Background="{Binding}"  Grid.Row="1" Grid.ColumnSpan="2" Foreground="Black" x:Name="treeViewSaldi">  
                            <telNav:RadTreeViewItem Header="CCC" Style="{StaticResource RadTreeViewItemStyle1}">  
                                <telNav:RadTreeViewItem.HeaderTemplate> 
                                    <DataTemplate> 
                                        <TextBlock FontSize="20" Text="CCC title" FontWeight="Bold"  /> 
                                    </DataTemplate> 
                                </telNav:RadTreeViewItem.HeaderTemplate> 
                                <IFDett:Saldi  x:Name="ucSaldi" /> 
                            </telNav:RadTreeViewItem> 
                        </telNav:RadTreeView> 
                        <telNav:RadTreeView Background="{Binding}"  Grid.Row="2" Grid.Column="0" Foreground="Black" x:Name="treeViewTotali">  
                            <telNav:RadTreeViewItem Header="Totali" Style="{StaticResource RadTreeViewItemStyle1}">  
                                <telNav:RadTreeViewItem.HeaderTemplate> 
                                    <DataTemplate> 
                                        <TextBlock FontSize="20" Text="Totali" FontWeight="Bold"  /> 
                                    </DataTemplate> 
                                </telNav:RadTreeViewItem.HeaderTemplate> 
                                <IFDett:Totali  x:Name="ucTotali" /> 
                            </telNav:RadTreeViewItem> 
                        </telNav:RadTreeView> 
                        <telNav:RadTreeView Background="{Binding}"  Grid.Row="2" Grid.Column="1" Foreground="Black" x:Name="treeViewMacro">  
                            <telNav:RadTreeViewItem Style="{StaticResource RadTreeViewItemStyle1}">  
                                <telNav:RadTreeViewItem.HeaderTemplate> 
                                    <DataTemplate> 
                                        <TextBlock FontSize="20" Text="Macrocategoria" FontWeight="Bold"  />    
                                    </DataTemplate> 
                                </telNav:RadTreeViewItem.HeaderTemplate> 
                                <IFDett:Macrocategoria  x:Name="ucMacro" /> 
                            </telNav:RadTreeViewItem> 
                        </telNav:RadTreeView> 
                    </Grid> 
                </Grid> 
                <telerik:RadProgressBar Grid.Row="0" x:Name="pb" Width="260" Height="30" Minimum="0" Maximum="1000" Margin="0,0,0,30" IsIndeterminate="True" Visibility="Collapsed" /> 
            </StackPanel> 
        </ScrollViewer> 
    </UserControl> 
     
          
         
  4. Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 12 Jan 2010 Link to this post

    Hello Paolo,

    As far as I saw in your project the style of TreeviewItem has only UnSelected State. I remove this state from the style and now the TreeviewItem doesn't have any state. Please find attached an example. If you have further questions please do not hesitate to ask us.

    I hope this will help you.

    Sincerely yours,
    Dimitrina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Michele
    Michele avatar
    426 posts
    Member since:
    Jun 2009

    Posted 14 Jan 2010 Link to this post

    Thanks a lot Dimitrina,
    it works like a charm!
Back to Top