I'm trying to add new rows to a DataGrid on a WPF application when clicking on a specific button. This is what I tried so far:
DataGridRow row = new DataGridRow();
table.Items.Add(row); // table = my DataGrid
When I run this code, it throws a System.ArgumentNullException
saying
Value cannot be null
What should I do to solve this problem? Thanks in advance.