title: Copy data from one datagridview to another in c#
body: <pre><code>for (int i = 0; i &lt; form2.dataGridView1.Rows.Count; i++)
  {                  
  
      if ( form2.dataGridView2.Rows[i].Cells[0].Value != null &amp;&amp; 
           (bool) form2.dataGridView2.Rows[i].Cells[0].Value == true )
      {
          form2.dataGridView2.Rows.Add();
          for (int j = 1; j &lt; form2.dataGridView1.Columns.Count; j++)
              form2.dataGridView2.Rows[i].Cells[j].Value = 
                  form2.dataGridView1.Rows[i].Cells[j].Value;
  
      }
  
  }  
  </code></pre>
  
  <p>the above code is not giving any result. please tell me how to copy the data of one datagridview to another?               </p>