DataGrid InLine Editing - no delete after insert

I posted this is the issues on Github but maybe better here. It isn't a problem with the component. Maybe some sample code. The DeleteRow method in the official example here does nothing if you try to delete immediately after adding a row. I put some comments in my code to confirm nothing was happening. Is there any tips on getting this to work?

async Task DeleteRow(Order order)
{
    if (order == orderToInsert)
    {
        orderToInsert = null;
    }

    if (orders.Contains(order))
    {
        dbContext.Remove<Order>(order);

        // For demo purposes only
        orders.Remove(order);

        // For production
        //dbContext.SaveChanges();

        await ordersGrid.Reload();
    }
    else
    {
        ordersGrid.CancelEditRow(order);
    }
}

The DeleteRow method from the demo sets orderToInsert to null for newly inserted items which are not saved. Seems to work as expected - here is a screenshot from the debugger:

The rest of the code checks of the order exists in the collection and deletes it if this is the case.

Ah yes. What I've done is is implemented the code commented "For Production" but when I run through the DeleteRow() method it drops to the final else block.


then:

(primary key for the table is showing...17117):
At this stage clicking the delete button does nothing unless I reload the page. And I get the comment output "Nothing happened on delete"

    async Task DeleteRow(Serial serial)
    {
        Console.WriteLine("Delete Row Clicked...");
        if (serial == serialToInsert)
        {
            serialToInsert = null;
            Console.WriteLine("Didn't find serial object do not deleting...");
        }
        if (serialItems.Contains(serial))
        {
            Console.WriteLine("Found serial object so deleting...");
            dbContext.Remove<Serial>(serial);
            // For demo purposes only
            serialItems.Remove(serial);
            // For production
            dbContext.SaveChanges();
            try
            {
                await serialGrid.Reload();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error Reloading Grid..." + ex.Message.ToString());
            }
            finally
            {
                Console.WriteLine("Deleted and reloaded");
            }
        }
        else
        {
            Console.WriteLine("Nothing happened on delete");
            serialGrid.CancelEditRow(serial);
        }

    }

BTW - all other features work (e.g., update, cancel update, etc...)

I needed to reload the data back into the grid and now it works....

    async Task SaveRow(Serial serial)
    {
        if (serial == serialToInsert)
        {
            serialToInsert = null;
        }

        await serialGrid.UpdateRow(serial);
          // Add this to enable delete after insert....
        await OnInitializedAsync();
    }

Thanks...okay to close.