title: Show Sub Menu on right Click On DataGridView - C#
body: <p>Hi I added a right click event on my <code>datagridview</code> which shows menu but I want to show a sub menu when clicked or mouse hover on one of the <code>menuItem</code></p>
  
  <pre><code>protected void datagridview1_MouseClick(object sender, MouseEventArgs  e)
      {
          if (e.Button == MouseButtons.Right)
          {
              ContextMenuStrip my_menu = new ContextMenuStrip();
              int position_xy_mouse_row = dataGridView1.HitTest(e.X, e.Y).RowIndex;
  
              if (position_xy_mouse_row &gt;= 0)
              {
                  my_menu.Items.Add("Show Details").Name = "Details";
  
                  if ((SecurityLevel == "something" &amp;&amp; dataGridView1.SelectedRows[0].Cells[8].Value.ToString() == "value1") || (SecurityLevel == "something" &amp;&amp; dataGridView1.SelectedRows[0].Cells[8].Value.ToString() == "value2"))
                  {
                      my_menu.Items.Add("update").Name = "Update ";
                      if (dataGridView1.SelectedRows[0].Cells[8].Value.ToString() == "value1")
                      {
                          MenuItem updateStatus = new MenuItem("Update");
                          updateStatus.MenuItems.Add(new MenuItem("somevalue").Name = "somevalue");
                          updateStatus.MenuItems.Add(new MenuItem("someothervalue").Name = "someothervalue");
                      }
                      if (dataGridView1.SelectedRows[0].Cells[8].Value.ToString() == "value2")
                      {
                          MenuItem updateStatus = new MenuItem("Update");
                          updateStatus.MenuItems.Add(new MenuItem("someothervalue").Name = "someothervalue");
                          updateStatus.MenuItems.Add(new MenuItem("newvalue").Name = "newvalue");
                      }
                  }
              }
              my_menu.Show(dataGridView1, new Point(e.X, e.Y));
              my_menu.ItemClicked += new ToolStripItemClickedEventHandler(my_menu_ItemClicked);
          }
      }
  </code></pre>
  
  <p>but I can only see 2 menuitems on my menu which are <code>Show Details</code> and <code>Update</code>,  I can't see the sub menu for update.</p>