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

How do I get the mouse over item, and show tooltip

1 Answer 78 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Tao Jiang
Top achievements
Rank 1
Tao Jiang asked on 22 Oct 2009, 03:46 PM
Hi,

I am using Treeview to show a recursive data structure. I would like to get the item when mouse is over, process the value of the item and show tooltip.

How can I get the item?

Thanks,

1 Answer, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 23 Oct 2009, 12:42 PM
Hi Tao,

Below is a code snippet that demonstrates how to display a tooltip for each treeview item, depending on some information contained in the business object that the treeview item is data bound to:

<telerikNavigation:RadTreeView x:Name="treeView">
    <telerikNavigation:RadTreeView.ItemTemplate>
        <DataTemplate>
            <Grid ToolTipService.ToolTip="{Binding TootipText}">
                <TextBlock Text="{Binding Header}" />
            </Grid>
        </DataTemplate>
    </telerikNavigation:RadTreeView.ItemTemplate>
</telerikNavigation:RadTreeView>

In the sample the tooltip is bound to a text property called TooltipText. In case you need to do some more complex operation to determine the tooltip content, you can create a ValueConverter to do whatever you need to do to get the required tooltip.

Let me know if you have other questions.

Kind regards,
Tihomir Petkov
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.
Tags
TreeView
Asked by
Tao Jiang
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Share this question
or