Question:
There is an array of objects of class Supplier
, let's say it's an array of suppliers
data suppliers. How to output this array as a table in DataGrid in WPF? In WindowsForms, this is done by assigning
datagrid.datasource = suppliers;
In WPF, the datagrid does not have a datasource property.
Answer:
In WPF, collections are exposed via ItemsSource
:
datagrid.ItemsSource = suppliers;