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

Edit in line grid on update send empty model to server

2 Answers 465 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marc Jr
Top achievements
Rank 1
Marc Jr asked on 17 Jun 2020, 07:23 PM

I have a simple grid and try to get the updated row on server side but the model send is always empty

Client side Grid (View)

<div class="card-body">
        @(Html.Kendo().Grid<CoopTel_MultiLocation.Models.DummyModel>()
                    .Name("grid")
                    .Columns(columns =>
                    {
                        columns.Bound(p => p.Col1).Filterable(false);
                        columns.Bound(p => p.Col2);
                        columns.Bound(p => p.Col3);
                        columns.Bound(p => p.Col4);
                        columns.Bound(p => p.Col5);
                        columns.Bound(p => p.TestBooleen);
                        columns.Command(command => { command.Edit(); command.Destroy(); }).Title("Commandes").Width(250);
                    })
                    .Editable(editable => editable.Mode(GridEditMode.InLine))
                    .Pageable()
                    .Sortable()
                    .Scrollable()
                    .ToolBar(toolbar =>
                    {
                        toolbar.Search();
                        toolbar.Create();
                    })
                    .HtmlAttributes(new { style = "height:550px;" })
                    .DataSource(dataSource => dataSource
                        .Ajax()
                        .PageSize(20)
                        .Model(model => { model.Id(p => p.Col1); })
                        .Read(read => read.Action("GetLocationUI", "GestionLocation"))
                        .Update(update => update.Action("DetailLocationUpdate", "GestionLocation"))
                        .Destroy(destroy => destroy.Action("DetailLocationDestroy", "GestionLocation"))
                        .Create(update => update.Action("DetailLocationCreate", "GestionLocation"))
                    )
        )
    </div>

GestionLocationController

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult DetailLocationUpdate([DataSourceRequest] DataSourceRequest request, DummyModel Locations) <-- Location is always empty 
        {
            return Json("");
        }

2 Answers, 1 is accepted

Sort by
0
Accepted
Neli
Telerik team
answered on 19 Jun 2020, 10:27 AM

Hi Marc,

The provided code seems correct and I could not suggest a possible reason for the caused issue.

Attached you will find a sample project with a Grid with inLine editing and similar configuration. May I ask you to modify the sample in order to replicate the behavior the way it is at your end and send it back to us? This way we could take a look closely and provide you further assistance. Note, that dependencies are deleted due to the size limits. 

Looking forward for your reply.

Regards,
Neli
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.
0
Marc Jr
Top achievements
Rank 1
answered on 22 Jun 2020, 12:56 PM
thank you very much I use your simple in my code and it work perfectly. Thanks for the support
Tags
Grid
Asked by
Marc Jr
Top achievements
Rank 1
Answers by
Neli
Telerik team
Marc Jr
Top achievements
Rank 1
Share this question
or