Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7962295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:18:05+00:00 2026-06-04T05:18:05+00:00

I have a menu item that appears when right clicking over a datagridview. From

  • 0

I have a menu item that appears when right clicking over a datagridview. From their the user hovers over a menuitem and a list of other menu items appears, once again this repeats. Giving soemthing like this.

---------
|  FOO  |---------
---------|  BAR  |------------
          ---------|  FOOBAR  |
                   ------------

There is only to be an event (addressof) handled on the the 3rd tier. With that being said I need to grab the parent.name from FOOBAR and the parent.name of the said parent (grandparent).

Here is where I am at:

If currentMouseRow >= 0 AndAlso currentMouseColumn <= 1 Then
            dataGridView_monitorMapping.Rows(currentMouseRow).Selected = True
            mainMenu.MenuItems.Add(New MenuItem("Set Monitor(s) Settings"))
            mainMenu.MenuItems.Add(New MenuItem("Sync Monitor Mapping View", AddressOf triggerSync))
            'list avaliable priorites
            For Each priorityRow As DataRow In priorityTypesDS.Tables(0).Rows
                Dim rowPriortiyName As String = CStr(priorityRow("Priority"))
                Dim subMenu_priorities_item As New MenuItem(rowPriortiyName)
                mainMenu.MenuItems(0).MenuItems.Add(subMenu_priorities_item)
                'list avaliable boards
                For Each boardRow As DataRow In serviceBoardDS.Tables(0).Rows
                    Dim rowBoardName As String = CStr(boardRow("SvcBrd"))
                    Dim subMenu_boards_item As New MenuItem(rowBoardName)
                    subMenu_priorities_item.MenuItems.Add(subMenu_boards_item)
                    'list avaliable types based on board
                    If rowBoardName IsNot Nothing Then
                        Dim availableSvcTypes As DataSet = GetServiceTypes(_objhost, serviceTypes, rowBoardName)
                        For Each svcTypeRow As DataRow In availableSvcTypes.Tables(0).Rows
                            Dim rowSvcTypeName As String = CStr(svcTypeRow(1))
                            Dim subMenu_svcType_item As New MenuItem(rowSvcTypeName, AddressOf triggerSync)
                            subMenu_boards_item.MenuItems.Add(subMenu_svcType_item)
                        Next
                    End If
                Next
            Next
            mainMenu.Show(dataGridView_monitorMapping, New Point(e.X, e.Y))
        End If

And the event handler

Public Sub updateMultiRowSettingChange(ByVal Sender As System.Object, ByVal e As System.EventArgs)
    'TODO | Handle selection from right click menu.
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:18:06+00:00Added an answer on June 4, 2026 at 5:18 am

    Something like this should get you what you are looking for:

    Public Sub updateMultiRowSettingChange(ByVal Sender As System.Object, ByVal e As System.EventArgs)
        Dim item As MenuItem = CType(sender, MenuItem)
        Dim parent As MenuItem = CType(item.Parent, MenuItem)
        Dim grandparent As Menu = parent.Parent
    End Sub
    

    However, it may be simpler to set the tag on the menu item to whatever information you need to know where it’s coming from, then you could just check item.Tag after you cast it to the MenuItem class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen a few OSX apps that have a Special Characters menu item
I have a menu structure that is supposed to highlight each item as it
I have a menu that looks something like this: <MenuItem x:Name=menu ItemsSource={Binding Items} Style={StaticResource
I have a Menu page. If a user selects an Menu Item it opens
Ok I have a inline list of buttons. <ul id=nav> <li class=home><a href=#>Menu Item</a></li>
I have a navigation menu provider that I am trying to move over to
I have hooked up a context menu item in a listbox item such that
I have a Type MenuItem that has one-to-many relationship with itself through Children property.
I have a XAML MenuItem DataBound ItemsSource that is working fine however there is
I have a menu item Home in my main menu AND in my top

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.