Adding derived classes to a Binding Source of a DataGridView
<p>Using MVC Pattern in WinForms with C#</p>

<p>Three business object - an abstract LibraryItem Class ,a Book class and a journal class , both derives from LibraryItem</p>

<pre><code>//LibraryItem Class
public abstract class LibraryItem
{
    public string Title { get; set; }

    private static int _nextCallNum = 1000;

    public int CallNum { get; private set; }

    public int NumCopies { get; set; }
}

//Journal Class
 public class Journal : LibraryItem
{
    public int Vol { get; set; }
}

//Book Class
 public class Book : LibraryItem
{
    public string Author { get; set; }
}


//LibraryController Class 
  public class LibrayController
{

    //a List that can hold both books and journals
    private List&lt;LibraryItem&gt; items;

     //adds a book object to items
     public void AddBookItem(string title, int numCopies , string author) {.....}

      //adds a journal object to items
     public void AddJournal(string title, int vol, int numCopies){}

      //returns a List contaning books and journals to the View
      public List&lt;LibraryItem&gt; GetAllItems()
    {
        return items;
    }
}   
</code></pre>

<p>In Win Forms , using a DataGridView to display list of LibraryItems</p>

<pre><code>dataGridViewItems.DataSource = null;

booksbindingSource = new BindingSource();

 foreach (LibraryItem anitem in controller.GetAllItems())
        {

            LibraryItem aLibraryItem = (LibraryItem) anitem;

            booksbindingSource.Add(aLibraryItem);
        }

dataGridViewItems.DataSource = booksbindingSource;
</code></pre>

<p>When adding a book after journal, or a journal after book to the binding source, I get <em>InvalidOperationException Objects added to a BindingSource's list must all be of the same type</em>.</p>

<p>The description is self-explanatory. I need a way to display LibraryItems in a datagrid than can be both books and journals. I only need to display the base class properties(Title, CallNum and NumCopies of LibraryItem) in the datagrid.</p>