title: Index was out of range. Must be non-negative and less than the size of the collection in datagridview
body: <pre><code>private void dataGridViewSubLocation_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
      {
          //string id = dataGridViewSubLocation.SelectedRows[e.RowIndex].Cells[0].Value.ToString();
           id = Convert.ToInt32(dataGridViewSubLocation.SelectedRows[e.RowIndex].Cells[0].Value);
          masterLocComboBox.Text = dataGridViewSubLocation.SelectedRows[e.RowIndex].Cells[1].Value.ToString();
          txtLocName.Text = dataGridViewSubLocation.SelectedRows[e.RowIndex].Cells[2].Value.ToString();
          txtLocAddress.Text = dataGridViewSubLocation.SelectedRows[e.RowIndex].Cells[3].Value.ToString();
      }
  </code></pre>
  
  <p>...........
  here i;m using row index but still giving error.</p>