'Blazorise DataGrid syntax to create and execute Commands with parameters on a Button?

How does one save data (multiple rows) in a Blazorise DataGrid?

Is there an example of the code including the C# functions to update a database?



Solution 1:[1]

Blazorise uses automatic CRUD - but you need to call something like this in code:

async Task OnSaveClicked()
{

    // check validation if needed

    if (Items != null)
    {
        await _context.SaveChangesAsync();
    }

to update the database. It only needs to be done once for the whole grid.

I suggest using EditMode="DataGridEditMode.Inline for inline editing.

If an error occurs it will show a Reload at the bottom - check your browser developer tools to see what has caused the error.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ΩmegaMan