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
1440
Don't Display ContextMenu
posted

Hello

When the mouse is positioned over an area other than a winGridRow (Header for example) I do not want to display the windows.forms.contextmenu assigned to the grid. In other words, I'd like to be able to cancel the displaying of the context menu.  I've implemented the following code which doesn't work:

    Private Sub grd_MouseEnterElement(ByVal sender As Object, ByVal e As Infragistics.Win.UIElementEventArgs) Handles ug1.MouseEnterElement
        If TypeOf e.Element Is Infragistics.Win.UltraWinGrid.HeaderUIElement Or TypeOf e.Element Is Infragistics.Win.UltraWinScrollBar.ScrollBarUIElement Then
            popcontextmenu = False
        Else
            popcontextmenu = True
        End If
    End Sub

Then in my contextmenu popup event, the first test that I do is to see if I can display the menu based on the value of popcontextmenu.  It's always displaying. 

How can I accomplish this?

Thank you

Clay Seifert