I think you are looking for DG.ItemsSource = ds.Tables[0].AsEnumerable();
You are getting that error because the System.Windows.Controls.DataGrid
doesn't have a property named datasource
.
DataTableExtensions.AsEnumerable shows you how to make a DataTable into an Enumarable where T : DataRow