This is a migrated thread and some comments may be shown as answers.

Inline edit with combobox/dropdownlist and (non)nullable fields

1 Answer 10 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roel
Top achievements
Rank 1
Iron
Veteran
Roel asked on 15 Feb 2021, 02:43 PM

Hi,

While programming with Kendo MVC I am figuring out what a best practice is when using inline edit. Firstly I tried with a custom save with the clientside events of the grid. But performance wise I concluded that using datasource/transport is a better option. But now am I stuck with inline edit of fields with an editor template with a combobox/dropdownlist.

When I do an inline edit, another value is selected in the combobox/dropdownlist. I can see a postback is done. After the return of the save method serverside, the old value is selected. Then after a F5 the new value appears. In the serverside save method everything works fine.

.Update(update = { update.Url(Url.HttpRouteUrl("DefaultApi", new { controller = "TaskSchedulerApiV2", action = "Put" }));})

 

[System.Web.Mvc.HttpPut]
public List<TaskSchedulerGridViewModel> Put(TaskSchedulerGridViewModel task)
{
    //
}

 

Is it the return value of the put mehod or smething else?

Roel

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 17 Feb 2021, 12:25 PM

Hi Roel,

When working with the WebAPI, then the server-side code should return the updated row back to grid. Therefore, the grid on the client-side will know what values to bind and visualize. Could you try returning the updated data item after saving in the database and see if that works out in your case? 

https://demos.telerik.com/aspnet-mvc/grid/webapi

Under the View Source tab, you will find the WebAPI controller with the full implementation of the Put, Post, Destroy action methods.

Looking forward to your reply.

 

Kind regards,
Tsvetomir
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Roel
Top achievements
Rank 1
Iron
Veteran
Answers by
Tsvetomir
Telerik team
Share this question
or