I'm trying to get a simple data grid working under WPF, and I have no idea why it's not working. Here is the XAML -
<Window x:Class="WpfApplication2.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="333" Width="592">
<Grid>
<my:DataGrid AutoGenerateColumns="true" Margin="98,62,77,51" Name="dataGrid1" xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit">
</my:DataGrid>
</Grid>
</Window>
And here is the constructor for the window -
public Window1()
{
InitializeComponent();
DataClasses1DataContext dc = new DataClasses1DataContext();
dataGrid1.DataContext = dc.Customers.ToList();
}
DataClasses1 is just a Linq-2-SQL context mapping to the Northwind database. Can someone help?