title: datagridview cell click event
body: <p>I have an event for a cell click in a datagrid view to display the data in the clicked cell in a message box. I have it set to where it only works for a certain column and only if there is data in the cell</p>
  
  <pre><code>private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
  {
      if (dataGridView1.CurrentCell.ColumnIndex.Equals(3))
          if (dataGridView1.CurrentCell != null &amp;&amp; dataGridView1.CurrentCell.Value != null)
              MessageBox.Show(dataGridView1.CurrentCell.Value.ToString());
  }
  </code></pre>
  
  <p>however, whenever i click any of the column headers, a blank messagebox shows up. I cant figure out why, any tips?</p>