title: Show 2d-array in DataGridView
body: <p>I have a 2D array.  I want to print the array in my <code>DataGridView</code> but it throws an error:</p>
  
  <blockquote>
    <p>[Argument OutOfRangeException was unhandled ] </p>
  </blockquote>
  
  <p>This is my code </p>
  
  <pre><code>for (int j = 0; j &lt; height; j++)
  {
      for (int i = 0; i &lt; width; i++)
      {
              dataGridView1[i, j].Value = state[i, j].h;    
              //state[i, j].h this is my array 
              dataGridView1[i, j].Style.BackColor pixelcolor[i,j];
              dataGridView1[i, j].Style.ForeColor = Color.Gold;
      }
  }
  </code></pre>