title: How do I handle an event in C# based on a cell click in a DataGridView?
body: <p>FYI, I looked at existing postings and I did not find exactly what I needed.</p>
  
  <p>I am using Visual Studio 2008 to write a C# Windows Forms program.  I have a DataGridView object that displays data from a table.  When a user clicks on a cell I want to be able to grab the contents of that cell.</p>
  
  <p>How do get an action to take place whenever there is a click on any cell in the datagridview.  If the user clicks on the same cell 5 times in a row, I want the action to happen five times.</p>
  
  <p>I am not even sure what the name of the event handler would be.</p>
  
  <p>I tried the following, but it didn't work. </p>
  
  <p>This was the code on the FormName.cs file:</p>
  
  <pre><code>private void DATASOURCEDataGridView_CellContentClick(object sender, 
             DataGridViewCellEventArgs e)
  {
      MessageBox.Show("clicked");
  }
  </code></pre>
  
  <p>This was the code on the FormName.Designer.cs File:</p>
  
  <pre><code>this.DATASOURCEDataGridView.CellContentClick += 
      new System.Windows.Forms.DataGridViewCellEventHandler(
          this.DATASOURCEDataGridView_CellContentClick);
  </code></pre>
  
  <p>Thanks for the help!</p>