title: How to add a dictionary to a ContextMenuStrip
body: <p>I am currently trying to add to a context menu strip a dictionary of status values. The main issue I am having is how to pass in the Key value of the selected dictionary item to a click event.</p>
  
  <pre><code>Dictionary&lt;int, string&gt; statusList = getStatusList();
  
  if (statusList.Count &gt; 0)
  {
      Dictionary&lt;int, ToolStripItem&gt; statusMenu = new Dictionary&lt;int, ToolStripItem&gt;();
  
      foreach (var keyValuePair in statusList)
      {
           statusMenu.Add(keyValuePair.Key, new ToolStripMenuItem() { Text = keyValuePair.Value.ToString(), Image = Resources.Refresh });
           //statusMenu[statusMenu.Count - 1, statusMenu].Click += new EventHandler(MenuOption_Click_Handler); This is where I am confused
      }
      datagridview1.ContextMenuStrip.Items.Add(new ToolStripMenuItem("Set Status to", Resources.Refresh, statusMenu.Values.ToArray()));
  }
  </code></pre>
  
  <p>I can easily get the array of the dictionary values. I am just wondering if its possible upon clicking a status in the contextmenu to pass the Key to a save method? </p>
  
  <p>So, for example say statusList contains the following values:<br>
  {[1, Status1]}<br>
  {[2, Status2]}<br>
  {[5, Status3]}</p>
  
  <p>So if I load the contextmenu, if I click Status3, I need to pass to the ClickEvent that Status Key 5 was clicked. Right now its only detecting the Value (Status3). Any help is much appreciated!</p>