How to disable tooltip for the first node of RadTreeView

3 posts, 0 answers
  1. Divya
    Divya avatar
    6 posts
    Member since:
    Apr 2014

    Posted 01 Oct 2014 Link to this post


    I have defined a custom tooltip for RadTreeView. Also I have used HierarchicalDataTemplate for my RadTreeView. Code is as shown below.

     <telerik:RadTreeView Margin="8" IsDragDropEnabled="True"  Name="CollExperimentTreeView"  SelectedItem="{Binding ActiveExp, Mode=TwoWay}"
         SelectionMode="Single" IsSingleExpandPath="False" IsLineEnabled="True"   VerticalAlignment="Stretch"
           temTemplate="{StaticResource TreeViewTemplate}"  ItemsSource ="{Binding TreeViewCollection,  Mode=TwoWay}" />

    Custom tooltip and  HierarchicalDataTemplate  defined as below:

            <Style TargetType="{x:Type telerik:RadTreeViewItem}">
                <Setter Property="ToolTip" >
                                <StackPanel Orientation="Vertical">
                                    <StackPanel Orientation ="Horizontal">
                                        <TextBlock Text="Started:   " />
                                        <TextBlock Text="{Binding StartDate}" />
                                    <StackPanel Orientation ="Horizontal">
                                        <TextBlock Text="Last Changed:   " />
                                        <TextBlock Text="{Binding LastAccess}" />
                                    <TextBlock Text="{Binding Description}" />
            <HierarchicalDataTemplate x:Key="TreeViewTemplate" ItemsSource="{Binding Path=Experiments}">
                <TextBlock VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  Text="{Binding Name}" />              

    I do not want to display tooltip for those nodes that shows TextBlock containing Name,( HierarchicalDataTemplate )  

    Please help

  2. Petar Mladenov
    Petar Mladenov avatar
    3140 posts

    Posted 02 Oct 2014 Link to this post

    Hi Divya,

    You can use ItemContainerStyleSelector which will set Style will ToolTip on certain items and style with no tooltips on the other TreeViewItems. For the normal style you can just return base.SelectStyle in the StyleSelector class. We hope the following help article is a good starting point.

    RadTreeView ItemContainerStyleSelector

    Please let us know if you need further assistance with this requirement.

    Petar Mladenov
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. Divya
    Divya avatar
    6 posts
    Member since:
    Apr 2014

    Posted 07 Oct 2014 in reply to Petar Mladenov Link to this post

    Thank you...

    I was able to resolve the issue using ItemContainerStyle.

Back to Top