title: WinForms DataGridView - databind to an object with a list property (variable number of columns)
body: <p>I have a .NET class I'd like to show in a DataGridView, and the default databinding - setting the DGV's DataSource to the object - produces 90% of my requirements (i.e. it's outputting the public properties correctly and I can add sorting easily).</p>
  
  <p>However, one of the properties I need to bind is a List which contains data which needs to be in separate columns after the other databound items. I'm stuck on how best to implement this.</p>
  
  <p>My class looks something like this:</p>
  
  <pre><code>public class BookDetails
  {
      public string Title { get; set; }
      public int TotalRating { get; set; }
      public int Occurrence { get; set; }
      public List&lt;int&gt; Rating { get; set; }
  }
  </code></pre>
  
  <p>Ideally, I'd be able to expand that Rating property into a number of numeric columns to give an output like this at runtime:</p>
  
  <p>Title |  Total Rating |  Occurrence |  R1 |  R2 |  R3 ... RN</p>
  
  <p>It would also be useful to have Total Rating be calculated as the sum of all the individual ratings, but I'm updating that manually at the moment without issue.</p>