This is a migrated thread and some comments may be shown as answers.

TreeView - Tooltip for each Node item

5 Answers 186 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
smith
Top achievements
Rank 1
smith asked on 10 Feb 2010, 03:30 PM
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

5 Answers, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 12 Feb 2010, 02:10 PM
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.
0
smith
Top achievements
Rank 1
answered on 15 Feb 2010, 06:23 AM
HI

 Can u send me one example for using container binding.
0
Bobi
Telerik team
answered on 15 Feb 2010, 12:42 PM
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.
0
smith
Top achievements
Rank 1
answered on 16 Feb 2010, 11:09 AM
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 .

 

0
Bobi
Telerik team
answered on 17 Feb 2010, 02:11 PM
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.
Tags
TreeView
Asked by
smith
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
smith
Top achievements
Rank 1
Bobi
Telerik team
Share this question
or