title: populate nested list
body: <p>I have a program that generates a grid of buttons and i want to store these buttons in an nested array list but the way I am doing does not seem to be correct</p>
  
  <p>This is my code:</p>
  
  <pre><code>        List&lt;List&lt;Button&gt;&gt; buttonsList = new List&lt;List&lt;Button&gt;&gt;();
          List&lt;Button[]&gt; rowList = new List&lt;Button[]&gt;();
  
          //Some method that creates a grid of buttons
          buttons = new Button[row][];
          for (int r = 0; r &lt; row; r++)
          { 
              buttons[r] = new Button[col];
              buttonsList.Add(rowList[r]);    
              for (int c = 0; c &lt; col; c++)
              {
                  buttons[r][c] = new Button();
                  rowList[c].Add(buttons[r][c]);
              }
          }
  </code></pre>