title: How to get a specific cell in a DataGridView on selection changed
body: <p>With a listbox, I have the following code to extract the item selected:</p>
  
  <pre><code>    private void inventoryList_SelectedIndexChanged(object sender, EventArgs e)
      {
          String s = inventoryList.SelectedItem.ToString();
          s = s.Substring(0, s.IndexOf(':'));
          bookDetailTable.Rows.Clear();
          ...
          more code
          ...
      }
  </code></pre>
  
  <p>I want to do something similar for a DataGridView, that is, when the selection changes, retrieve the contents of the first cell in the row selected. The problem is, I don't know how to access that data element.</p>
  
  <p>Any help is greatly appreciated.</p>