title: why i cannot clear the rows in the datagridview control?
body: <p>I was doing this test, I need to re-load the datagridview with data every 4 seconds and the data was coming from a database.</p>
  
  <p>so i'v created a <strong>timer</strong> control by code and added an event handler to the <code>tick</code> event. Then in the tick event</p>
  
  <pre><code>void t1_Tick(object sender, EventArgs e)
  {
  
      dataGridView1.DataSource = null;
      dataGridView1.Rows.Clear();
      dt = Product.GetAllProductsBasicInfo();
      dataGridView1.DataSource = dt;
  
  }
  </code></pre>
  
  <p>above code works but when I move </p>
  
  <pre><code>dataGridView1.Rows.Clear();
  </code></pre>
  
  <p>before </p>
  
  <pre><code>dataGridView1.DataSource = null;
  </code></pre>
  
  <p>it will throw a run time error saying the rows cannot be cleared, I want to know why it throws this error, typically Clear() clears the datagridview?</p>
  
  <p>thanks</p>