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
210
right click context menu isn't based on item cursor is hovering over
posted

I'm not sure if this is the correct forums, please move if necessary.

 

I am using the UltraTreeView and when right click a tre item that is not selected. I need to tell the control what the currently hovered over item is without reseting the currently selected items.

For instance rows 2,3, and 5 are selected and user rights click on row 3. So when I show the context menu on right click it should be based row 3.

 When I only have 1 item selected its easy by setting the selected node to the node the cursur is hanging over, but when multiple nodes are selected I need a way to tell the menu which item the context menu should be based on.

 Any ideas?

Thanks,

Nick

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Nick,

        How are you displaying the ContextMenu? Are you doing it in code, or are you just setting the ContextMenu property on the control?

        Either way, you will probably need to determine the node under the mouse using the GetNodeFromPoint method of the tree. If you are shoing the context menu yourself, this will be easier, since you will probably be using the MouseUp event and you will have the mouse coords. If you are just using the ContextMenu property, then it will be a little trickier, since you will need to convert the current mouse position into control coords. 

Children