Here is the code for a simple example doing what you want. It is from the code behind for a simple form with one DataGridView control on it.
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
BindingList<BindingClass> data = new BindingList<BindingClass>() {
new BindingClass { Name = "joe", Surname = "bloggs" },
new BindingClass { Name = "sue", Surname = "bloggs" } };
dataGridView1.DataSource = data;
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
}
}
public class BindingClass
{
public string Name { get; set; }
public string Surname { get; set; }
}
}
I've created a custom object to use for my data - this is where your list goes. All the public properties of lists bound to the DataGridView's datasource get created as columns - you can then hide unwanted columns.
In my example I've chosen to use a BindingList<T> rather than a List<T> - this is generally preferred since it gives you editing and can be extended to support sorting.
I also set the AutoSizeColumnsMode of the grid to Fill - there are several other options including setting the width or fill properties of each column individually, and these can also be set through the designer.
I don't recommend using a ListView since it doesn't offer automatic databinding.