I wish to bind an ArrayList of data objects to a DataGridView. If the ArrayList contains objects of simple types no problem the grid is populated as expected with public property names.
However, if the objects of the ArrayList themselvescontain an object member, the object is representing in the grid by a single 'object' column. How do I implement Databinding to expand the member objects such as the "employee" objects shown below?
BindingSource bs = new BindingSource(data,"Teams");
this.dataGridView1.DataSource = null;
this.dataGridView1.DataSource = bs;
this.dataGridView1.Refresh();
class Team
{
private Employee leader;
private Employee runt;
private string name;
//Public Properties
}
class Employee
{
private string name;
private string id;
//Public Properties
}
As a newbie a code example would be greatly appreciated. Thank you.