An item added to the DataGrid through InsertRow makes the item show up as a new row on the grid, but it cannot be found in DataGrid.Data which I find strange.
await grid.InsertRow(item);
bool found = grid.Data.Contains(item);
Console.WriteLine($"Inserted row was found: {found}");
Alright. I'm having some troubles with how the grid behaves based on the inline editing example.
It is possible to add multiple empty rows.
It is possible to edit one row and then start editing another row, leaving the first row with unsaved changes.
So if I add 2 new rows and then go to edit another row, one of the new rows disappears, but the other new row is neither in the DataGrid.Data, nor in the backing collection since the RowCreate event is never raised.
It seems I have to keep track of when there is a new rows myself then and prevent more rows from being added until the new row has been created or canceled?