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

TreeviewItem onMouseEnter also fires the event for its father

1 Answer 111 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Diego
Top achievements
Rank 1
Diego asked on 28 Aug 2013, 09:16 PM
Hi,

I'm having troubles with the onMouseEnter and onMouseLeave for the RadTreeViewItems.

Each time the mouse is over an item I need to show an image ("Gear")  beside this RadTreeviewItem. I'm showing this image with the onMouseEnter event and i'm hiding it with the onMouseLeave event. The problem is when i select a RadTreeViewItem that is inside another RadTreeViewItem. It shows its "Gear" and also its father "Gear".

The event is fired by the item that got the mouseOver and by all its fathers. the event should be fired only by the item with the mouse over.

can you please advise me?

thanks



1 Answer, 1 is accepted

Sort by
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 02 Sep 2013, 12:00 PM
Hello Diego,

I am not sure that I fully understand your scenario. Can you please elaborate more on your current implementation. How you try to subscribe to the mouse events?

Please note that the mouse events are routed UI events, this means that they travel up (or down) the visual tree and are invoked for each  UI element. Hence the behavior that you report is expected.

In order to achieve your requirement you can also extract the default template of the RadTreeViewItem and customize the MouseOver visual state. You can find more information about extracting styles in this article.

Please try to customize the default template and let me know if you need any further assistance.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
TreeView
Asked by
Diego
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or