0

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.

2 Answers 2

2

For Datatable we do

mydatagrid.ItemSource = mydatatable.DefaultView
Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.