Reputation: 301
In WinForms i do this:
var fromtable = from a in Table1 select a;
DataGridView.DataSource = fromtable;
And i see data. How make same in wpf application?
If i do like this:
Museum_TrueEntities me = new Museum_TrueEntities();
var test = from a in me.Authors select a;
dataGrid1.ItemsSource = test;
In result DataGrid is empty.
Upvotes: 0
Views: 5001
Reputation: 22445
dont forget to set AutogenerateColumns=true in your datagrid.
if you create the columns by your self post some xaml and set the correct binding.
Upvotes: 1
Reputation: 48568
For Datatable we do
mydatagrid.ItemSource = mydatatable.DefaultView
Upvotes: 2