just assign the name of the collections to the DataSource property and the names of the properties of the class as mapping name. Here is a short sample:
Code:
public class Person
{
private string mName;
private string mPhone;
public string Name
{
get{return mName;}
set{mName = value;
}
public string Phone
{
get{return mPhone;}
set{mPhone = value;}
}
}
// Code for DataSet assuming binding an IList of Persons
IList persons = GetPersonList();
dataSet1.DataSource = persons;
// following can also be done in the designer
((DataGridTextboxColumn)dataSet1.TableStyles[0].GridColumnStyles[0]).MappingName = "Name";
((DataGridTextboxColumn)dataSet1.TableStyles[0].GridColumnStyles[1]).MappingName = "Phone";
You didn't say if you use .NET 1.1 or 2.0. In .NET 1.1, if you want to support sorting or insert new rows the concrete IList must support the IBindingList interface which you have to implement yourself.
For .NET 2.0 i'm not sure if the Framework provided collections support IBindingList.
Regards
Klaus