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 regardsAndy
Hmm... any news on this one?
Hello.
The UltraToolbarsManager can display a context menu, however it will not automatically hide the menu when the mouse leaves and hovers over some other control. The standard Windows Forms ContextMenuStrip doesn't do this either; this is non-standard behavior.
You would have to handle the ToolbarsManager AfterToolDropDown, MouseEnterElement, and MouseLeaveElement events and use a timer to determine how long you would want the menu to stay visible once the mouse leaves the PopupMenuControlUIElement.
Please let me know if you have any further questions.