title: How does one bind a complex object to a DataGridView?
body: <p>I have a class that follows the form:</p>
  
  <pre><code>public class Cat
  {
      public string Name { get; set; }
      public string Description {get; set; }
      public List&lt;Cheezburger&gt; Cheezbugers { get; private set; }
  };
  
  public class Cheezburger
  {
      public int PattyCount { get; set; }
      public bool CanHaz { get; set; }
  };
  </code></pre>
  
  <p>I want to be able to display a <code>List</code> of Cats this in a <code>DataGridView</code> as follows:</p>
  
  <pre><code>---------------------------------------------------------------------------------
  | Name     | Description  |  PattyCount | CanHaz   | PattyCount   | CanHaz  | etc
  --------------------------------------------------------------------------------
  | Felix    | Classic Cat  |  1          | true     | 3            | false   | etc
  | Garfield | Fat,Lazy Cat |  2          | false    | 7            | true    | etc
  </code></pre>
  
  <p>And so on... The goal being to list out all the <code>Cat</code>'s <code>Cheezbuger</code>s in the same row. If you simply try binding the list of <code>Cat</code>s you won't get this behavior.</p>
  
  <p>The problem is that I can't figure out how to do a do a complex binding of source between the <code>DataGridView</code> and the individual items in the list of <code>Cats.Cheezbugers</code>. For what its worth, I know for sure that each <code>Cat</code> in the list has the same number of <code>Cheezbuger</code>s in its list.</p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>I am aware that <a href="https://stackoverflow.com/questions/4891644/datagridview-complex-binding">DataGridView complex binding</a> asks the same question, but the accepted answer works only if I know how many items are in the list ahead of time, and that is not the case. All I know is that all the lists will have the same length.</p>