Declined
Last Updated: 16 Jun 2020 10:00 by ADMIN
Lyle
Created on: 16 Jun 2020 09:54
Category: UI for Blazor
Type: Feature Request
0
Grid Inline Editing - demo database update

Submitted on customer behalf:

This line of code is taken directly out of your https://demos.telerik.com/blazor-ui/grid/editing-inline

What kind of magic updates the actual database?

 

privatevoidUpdateItem(GridCommandEventArgs args)

{

var argsItem = args.ItemasProductBindingModel;

var index =GridData.FindIndex(i => i.ProductId== argsItem.ProductId);

if(index !=-1)

{

GridData[index]= argsItem;

}

}"


1 comment
ADMIN
Marin Bratanov
Posted on: 16 Jun 2020 10:00

Hello Lyle,

This demo does not update the database, you can easily check that by editing a row, then reloading the page - it will have the initial values.

To update a database, you should call your data service to do so in an actual app. In this demo, we don't update it because it would pollute the database very quickly and subsequent visitors may have issues. We only update the view-model in the demo.

You can read more about how editing in the grid works here: https://docs.telerik.com/blazor-ui/components/grid/editing/overview

For example, this demo calls a service to update the database: https://demos.telerik.com/blazor-ui/grid/overview

 

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.