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
2549
Autohide contextmenu on mouse out
posted

Hi all,

I have implemented a context menu for my ultragrid.
The MouseUp event of the grid determines the related UIElement and displays the context menu as shown here:


        void ultraGrid_MouseUp(object sender, MouseEventArgs e)
        {
            Point mousePoint = new Point(e.X, e.Y);
            UIElement element = ((UltraGrid)sender).DisplayLayout.UIElement.ElementFromPoint(mousePoint);
            UltraGridCell cell = element.GetContext(typeof(UltraGridCell)) as UltraGridCell;
 

            if (e.Button == MouseButtons.Right)
            {          
                    toolbarmanager.ShowPopup("NotificationGridContextDefault", ultraGrid.PointToScree(mousePoint));            
            }
        }

 

so far everything works and the context menu is shown.

Problem is that it does not go away when the mouse leaves the menu without clicking anything.
Only when left clicking somewhere else...

Can this be done somehow?
Any advice is kindly appreciated

best regards
Andy