title: How do I correctly position a Context Menu when I right click a DataGridView's column header?
body: <p>I would like to extended DataGridView to add a second ContextMenu which to select what columns are visible in the gird. The new ContextMenu will be displayed on right click of a column's header.</p>
  
  <p>I am having difficulty get the correct horizontal position to show the context menu. How can I correct this?</p>
  
  <pre><code>public partial class Form1 : Form
  {
      DataGridView dataGrid;
      ContextMenuStrip contextMenuStrip;        
  
      public Form1()
      {
          InitializeComponent();
  
          dataGrid = new DataGridView();
          Controls.Add(dataGrid);
          dataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
          dataGrid.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(ColumnHeaderMouseClick);
          dataGrid.DataSource = new Dictionary&lt;string, string&gt;().ToList();
  
          contextMenuStrip = new ContextMenuStrip();
          contextMenuStrip.Items.Add("foo");
          contextMenuStrip.Items.Add("bar");
      }
  
      private void ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
      {
          if (e.Button == System.Windows.Forms.MouseButtons.Right)
          {
              contextMenuStrip.Show(PointToScreen(e.Location));
          }
      }
  }
  </code></pre>