XAML
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<DataGrid Height="117" HorizontalAlignment="Left" Margin="43,12,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="200"
ItemsSource="{Binding}" AutoGenerateColumns="False" >
<DataGrid.Columns>
<DataGridTextColumn
Header="Id" Binding="{Binding Id}"/>
<DataGridTextColumn
Header="Name" Binding="{Binding Name}"/>
</DataGrid.Columns>
</DataGrid>
* FROM WHAT I THINK I READ IN THE DOCS, THIS WOULD
MAKE A ROW FOR EACH ITEM IN THE COLLECTION AND A COLUMN FOR
EACH PROPERTY *
<DataGrid AutoGenerateColumns="True" Height="117" HorizontalAlignment="Left" ItemsSource="{Binding}" Margin="43,135,0,0" Name="dataGrid2" VerticalAlignment="Top" Width="429">
</DataGrid>
</Grid>
</Window>
DATA
namespace WpfApplication1
{
public class Foo
{
public int Id { get; set; }
public string Name { get; set; }
}
class Data
{
public static IEnumerable<Foo> Foos
{
get
{
for (int i = 0; i < 5; i++)
{
yield return new Foo { Id = i, Name = "Foo" + i.ToString() };
}
}
}
}
}
INIT
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
dataGrid1.DataContext = Data.Foos;
dataGrid2.DataContext = Data.Foos; // corrected thanks to post/answer
}
}
RESULT
Edit After correction from poster (thanks!) I have the right number of rows but no columns. (this is what I was seeing before I put together this post and would have been the original question if I hadn’t goofed up)

EDIT:
Try this
And here’s some useful material on ObservableCollection.