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

TreeViewItem MouseEnter does not fire

3 Answers 66 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Raj
Top achievements
Rank 1
Raj asked on 16 Mar 2010, 04:47 PM
I noticed that the TreeViewItem MouseEnter event does not get fired when moving from a child leaf node to it's parent. I guess if you're already over a child node it could be considered as also being "in"  the parent so the MouseEnter does not fire for the parent. Is this by design or is it a bug?

Thanks,
R

3 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav
Telerik team
answered on 16 Mar 2010, 07:53 PM
Hi Raj,

It is indeed by design - this is how the events in Silverlight work. Of you have a visual objects that contains another visual object moving your mouse from the child to its parent is not regarded as a "MouseEnter".

I cannot offer a workaround for this since we cannot alter how the input events work.

If you can tell us what you are trying to achieve then we could possibly come up with an alternative way to do it.

Kind regards,
Miroslav
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
Raj
Top achievements
Rank 1
answered on 16 Mar 2010, 08:30 PM
I have a context menu that appears when you right click on a node. The menu items are different based on node type - folder, leaf, etc. I was using the MouseEnter to properly configure the menu so when you right-click you get the correct set of items.

I'm now using the MouseMove event to do the same. I just have to be real efficient about how I do this since the MouseMove fires so often. But this seems to be working fine.

Thanks for the info,
Raj
0
Miroslav
Telerik team
answered on 19 Mar 2010, 04:29 PM
Hi Raj,

I can suggest using the RadContextMenu.Opened event to do this. You can even use a class event handler to handle this event on all TreeViewItems in the application like so:

static MainPage()
{
    EventManager.RegisterClassHandler(typeof(RadTreeViewItem), 
        RadContextMenu.OpenedEvent, 
        new RoutedEventHandler(OnTreeViewItemContextMenuOpened));
}
  
private static void OnTreeViewItemContextMenuOpened(object sender, RoutedEventArgs e)
{
}

Hopefully this will help you,

Regards,
Miroslav
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
Raj
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Raj
Top achievements
Rank 1
Share this question
or