WPF datagrid binding: add new item

I have the following window in my application:

alt text

The list is declared as: IList <Supplier> _editList ; and the datagrid is entered via: dataGridVendors.ItemsSource = _editList;

The Create button creates a new provider and adds the _editList to the provider. Supplier Provider = New Vendor (); _editList.Add (provider);

Unfortunately ... the new provider does not appear in the datagrid ........ any ideas on how to make the new item?

Regards, Sebastian

+3
source share
1 answer

Use ObservableCollection :

IList<Vendor> _editList = new ObservableCollection<Vendor>();

.

+9

Source: https://habr.com/ru/post/1768915/


All Articles