title: ToolStripMenuItem_Click(object sender, EventArgs e) - casting back to a DataGridView
body: <p>I have a <strong>WINFORM</strong> app with a <strong>DataGridView</strong> control , hooked into a <strong>ContextMenuStrip</strong> control.<br>
  The <strong>ContextMenuStrip</strong> fires events to essentially perform copy / paste between the <strong>DataGridView</strong> and the <strong>Clipboard</strong>.</p>
  
  <pre><code>private void copyToolStripMenuItem_Click(object sender, EventArgs e)
  {
    CopyClipboard();
  }
  
  private void CopyClipboard()
  {
    DataObject d = myGrid.GetClipboardContent();
    Clipboard.SetDataObject(d);
  }
  
  private void pasteCtrlVToolStripMenuItem_Click(object sender, EventArgs e)
  {
    PasteClipboard();
  }
  </code></pre>
  
  <p>I've added another <strong>DataGridView</strong> to my application and wish to share <strong>ContextMenuStrip</strong> between them since, per my code above, it's hardcoded to my grid, <strong>myGrid</strong>.</p>
  
  <p>I believed it would simply be an easy exercise to modify my code to cast a new <strong>DataGridView</strong> control from the <strong>sender</strong>:</p>
  
  <pre><code>private void copyToolStripMenuItem_Click(object sender, EventArgs e)
  {
    CopyClipboard(sender);
  }
  
  private void CopyClipboard(object sender)
  {
    var grid = (DataGridView)sender;
    DataObject d = grid.GetClipboardContent();
    Clipboard.SetDataObject(d);
  }
  
  private void pasteCtrlVToolStripMenuItem_Click(object sender, EventArgs e)
  {
   var grid = (DataGridView)sender;
    PasteClipboard(grid);
  }
  </code></pre>
  
  <p>but of course, I found that the <strong>sender</strong> was instead the <strong>ToolStripMenuItem</strong>.</p>
  
  <p>Is there a way to reference the original <strong>DataViewGrid</strong> via the <strong>sender</strong>, or <strong>EventArgs e</strong> ?</p>
  
  <p>And, thank you for reading :)</p>