c# – How to use an array of objects as a data source in a DataGrid in WPF?


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.


In WPF, collections are exposed via ItemsSource :

datagrid.ItemsSource = suppliers;
Scroll to Top