TreeView - Tooltip for each Node item

6 posts, 0 answers
  1. smith
    smith avatar
    54 posts
    Member since:
    Mar 2009

    Posted 10 Feb 2010 Link to this post

    HI

    I am Working for the TreeView,  using Hierarchical Template , programmatically build the treeView,
    for my scenario is each Node item i need to show the tool tip , i tried for Itemprepared event and Hierarchical Template


    Tool tip is not coming .  tooltip  i need to set programatically 
    pls send example for this one

  2. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 12 Feb 2010 Link to this post

    Hi smith,

    You can use a ContainerBinding that binds the tooltip content to a property of the underlying business object.

    Best wishes,
    Tihomir Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. smith
    smith avatar
    54 posts
    Member since:
    Mar 2009

    Posted 15 Feb 2010 Link to this post

    HI

     Can u send me one example for using container binding.
  4. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 15 Feb 2010 Link to this post

    Hi smith,

    Please find attached a sample project.
    Actually you can accomplish the desired functionality by using something like the following:

       <telerik:HierarchicalDataTemplate x:Key="PersonTemplate" >
        <TextBlock Text="{Binding Name}" Foreground="Red" FontSize="16" FontFamily="Verdana" ToolTipService.ToolTip="{Binding Name,Mode=TwoWay}"/>
    </telerik:HierarchicalDataTemplate>
    Please let us know if you have any other questions or need some more help.

    Regards,
    Bobi
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. smith
    smith avatar
    54 posts
    Member since:
    Mar 2009

    Posted 16 Feb 2010 Link to this post

    HI
      I am setting the tool tip in ItemPrepared Event.

     

     

    ToolTipService.SetToolTip(e.PreparedItem as UIElement, toolTipValue);

     if i move the mouse continously up and down Tool tip not coming but leave the mouse and come to the node tooltip is coming .
    also nodes are very closed attached how to give space b/w the Nodes .

     

  6. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 17 Feb 2010 Link to this post

    Hello smith,

    I added the following code to the project I sent you previously:

    void tree_ItemPrepared(object sender, Telerik.Windows.Controls.RadTreeViewItemPreparedEventArgs e)
            {
                ToolTipService.SetToolTip(e.PreparedItem as UIElement, "new text");
            }

    The tool tip behaves as expected. I was not able to reproduce your issue. Is it possible to send us some sample code or explain in more details the structure of your application?

    As to the question about the space between nodes the easiest way is to use MinHeight property of RadtreeViewItem:
    <Style TargetType="telerikNavigation:RadTreeViewItem" x:Key="treeViewItemStyle">
                <Setter Property="MinHeight" Value="40"/>
            </Style>
    ....
      <StackPanel x:Name="LayoutRoot" Background="White" Width="500" Height="500" HorizontalAlignment="Center" VerticalAlignment="Center">
            <telerikNavigation:RadTreeView  ItemContainerStyle="{StaticResource treeViewItemStyle}"
                SelectionMode="Multiple"    x:Name="tree" Foreground="White"
                ItemsSource="{Binding Source={StaticResource TreeViewDataSource}}"
                ItemTemplate="{StaticResource OrganizationTemplate}"
                HorizontalAlignment="Center" VerticalAlignment="Center"
                >
            </telerikNavigation:RadTreeView>


    Greetings,
    Bobi
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top