title: C# Win. Form - Data not reflecting when 2 datagridviews are set equal
body: <p>I have 2 forms (Form1, Form2) each having 1 <strong>datagridview</strong> with modifier <strong>Public</strong> and 1 button. The code written on the buttons are:-</p>
  
  <pre><code>Form2 f = new Form2();
  f.Show();
  f.datagridview1 = datagridview1;
  </code></pre>
  
  <h2>Problem</h2>
  
  <p>Now when i press the <strong>button of Form1</strong>, Form2 appears but the values in <strong>datagridview1 of Form1</strong> are not displayed in the <strong>datagridview1 of Form2</strong> but when i programmatically check for the values in <strong>datagridview1 of Form2</strong>, the values are there.</p>
  
  <h2>Solutions tried</h2>
  
  <ol>
  <li><strong>datagridview1.Refresh();</strong> - i tried to refresh the control of Form2 but no changes were seen.</li>
  <li><strong>f.Refresh();</strong> - i even tried to update the whole Form2 but still no changes were seen</li>
  </ol>
  
  <p><strong>Note</strong>:- I know i instead of writing <strong>f.datagridview1 = datagridview1;</strong> i can write a loop to populate the datagridview but i need to know what is the problem with the above code.</p>
  
  <p>Thanks in advance</p>