RadzenDataGrid Inline Editing: Cancelled New Row Does Not Disappear Immediately

Hi Radzen Team,

I'm using a RadzenDataGrid with inline editing enabled. When I add a new row and then click the cancel (X) button to discard the changes, I would expect the row to disappear immediately. However, the row remains visible in the grid until I close and reopen the page — only then is it gone, confirming that it was not saved.

I'm wondering if this behavior might be caused by the fact that I assign default values to the new row programmatically when it is created. Could this be preventing the grid from removing the unsaved row right away?

What would be the proper way to ensure that a new, unsaved row is immediately removed from the grid when the cancel button is clicked?

My CancelEdit method looks like this:

 protected async Task CancelEdit(WebAssets.Models.webassets.VstOptionenzeitraeume args)
 {
     grid0.CancelEditRow(args);
     await webassetsService.CancelVstOptionenzeitraeumeChanges(args);
     await grid0.Reload();
 }

Thanks in advance for your help!

20250805-0809-26.0526047

How is your grid bound? If this is WASM app with LoadData binding you might need to repopulate the variable assigned to Data - i.e. call the code that gets the data initially when page is loaded.

Thanks for your reply – the issue is resolved now.

To answer your question: I’m using a Blazor Server app (not WASM), and the grid is bound directly. This collection is populated from a SQLite database.

Your suggestion pointed me in the right direction: The row itself remained because it was still present in the bound data collection. I solved the issue by manually removing the entry from Collection instead of reloading it from the database, which is expected to be slower.

protected async Task CancelEdit(VstOptionenzeitraeume args)
{
    grid0.CancelEditRow(args);

    if (args.OpzId == 0) 
    {
        var list = vstOptionenzeitraeumeCollection.ToList();
        list.Remove(args);
        vstOptionenzeitraeumeCollection = list;
    }

    await grid0.Reload();
}