I have an array of base class Product
that contains objects of derived classes Medication
and Parapharmaceutical
.
In a DataGridView control, I am trying to display all the fields (fields of the base class that are in common and also the specific fields of each derived class).
dataGridView1.DataSource = ArrayOfProducts;
dataGridView1.ColumnCount = 6;
dataGridView1.Columns[0].Name = "Reference";
...
Now the question is how to bind the properties of the array objects to the columns (the objects are of a different type) ?