title: How to get values of DataGridView.Rows.Columns from Form 2 to Form 1
body: <ul>
  <li>DataGridView - Placed in Form - 2</li>
  <li>TextBox1 - Placed in Form - 1</li>
  </ul>
  
  <p>I want to access Data Grid View Row and Column value in Form - 1 and display in textbox.</p>
  
  <p>I'm writing this code below:</p>
  
  <pre><code>Form2 form2 = new Form2();
  DataGridView data = new DataGridView();
  data = form2.qualitySetupDataGridView;
  
  MessageBox.Show(data.Rows[0].Cells[1].Value.ToString());
  </code></pre>
  
  <p><strong><em>Error Message:</strong> Index was out of range. Must be non-negative and less than the size of the collection.</em>
  Parameter name: index</p>
  
  <p>Note: DataGridView Modifiers is set to public. I have 3-4 Records in the DataGridView that is placed in form-2.</p>