TreeviewItem onMouseEnter also fires the event for its father

2 posts, 1 answers
  1. Diego
    Diego avatar
    13 posts
    Member since:
    Aug 2012

    Posted 28 Aug 2013 Link to this post


    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?


  2. Answer
    Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1236 posts

    Posted 02 Sep 2013 Link to this post

    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.

    Pavel R. Pavlov
    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 >>
Back to Top