Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
610
xamTree with ContextMenu, selecting node on right click
posted

Hello,

I have a xamTree databound with three levels of nodes. I put a context menu on the tree control. Right now a user can right click a node to pop up the context menu to add a child node. The problem is that unless they first LEFT click the node, then RIGHT click the node for the context menu, I am unable to get the selected node to add the child.

 I tried adding a MouseRightButtonDown to the tree, but I get all different UIElements as the OriginalSource (could be TextBlock or Grid or Image depending on where they right clicked).

How can I select the node on right click before the context menu pops up?

 

Thanks,

-J