Update and Destroy method of Telerik Grid are not calling controller action method

0 Answers 19 Views
Getting started with ASP.NET
Shreesh
Top achievements
Rank 1
Shreesh asked on 10 Jun 2025, 11:55 AM | edited on 10 Jun 2025, 11:59 AM
We recently upgraded our application  with  latest version of Kendo UI, 2025.2.520.462. However, since the upgrade, we are facing challenges with existing features. Specifically, on the Kendo  grid update and destroy grid's methods are not calling our controller  end point whereas Read method is calling controller end point .For the reference I am sharing code below . Requesting you please help us on this blocker .In the previous version It was working .
.Read(r => r.Action("Get", "Order", new { totalCashCalculationId = totalCashCalculationId, langCode = langCode, brand=brand }))
.Update(update => update.Action("XYZABC_Update", "Order").Type(HttpVerbs.Post))
.Destroy(d => d.Action("XYZ_Destroy", "Order").Type(HttpVerbs.Post))

Ivan Danchev
Telerik team
commented on 11 Jun 2025, 03:49 PM

Hello,

When configuring the Update and Destroy actions, you must take into account what type of editing the Grid uses. If batch editing is set up, which is done by the following configuration of the Grid DataSource: .Batch(true), the argument of the Update and Destroy actions will be different than when batch is disabled. For comparison, check the View Source tab in the following 2 demos where you can see the configuration of the Grid, as well as the controller actions for both scenarios:

Editing with Batch disabled: https://demos.telerik.com/aspnet-core/grid/editing-inline 
Editing with Batch enabled: https://demos.telerik.com/aspnet-core/grid/editing 

Additionally, since you've specified the type of the request for the Update and Destroy operations to be POST, make sure the respective actions have the following annotation:

[AcceptVerbs("Post")]

If the issue remains after making the changes suggested above:
1. Check the browser dev tools Console and Network tabs. You should be able to see whether a request to one of the actions is sent and if it fails. 
2. Post the whole declaration of the Grid, as well as the declaration of the Update and Destroy actions. 

Shreesh
Top achievements
Rank 1
commented on 12 Jun 2025, 11:14 AM

Hi Ivan Danchev, thanks for the quick response . I want to share some more details with you so that you can figure out the issue .

1. Kendo we are using with ASP.net MVC application .

2.Same existing code was working fine after Kendo upgrade we started facing issues.

3. Below You can find how we configured Kendo grid. 

 @(Html.Kendo().Grid<DocumentAppendixModel>()
                .Name("GridAppendixDocuments")
                .Columns(columns =>
                {
                    columns.Bound(p => p.IncludedInOrder).Hidden(true);
                    columns.Bound(p => p.DocumentAppendixId).Hidden(true).Filterable(false);
                    columns.Bound(p => p.uploadedFile).Hidden(true).Filterable(false);
                    columns.Bound(c => c.FileDescription).Title(MarketResource.Description).EditorTemplateName("TextAreaTemplate");
                    columns.Bound(p => p.IsDownload).Sortable(false).Width(48).Title("").Filterable(false)
                        .ClientTemplate(
                            "<a href='" +
                            Url.Action("DownloadAppendixDocFile", "Market") +
                            "?documentAppendixId=#= DocumentAppendixId #" +
                            "&brand=#= '" + ViewBag.brand + "' #" +
                            "&totalCashCalculationID=#= TotalCashCalculationId #'" +
                            " class='icon icon-download as-k-button' ></a>"
                        );
                    columns.Command(command =>
                    {
                        command.Destroy();
                    }).Width(48).Title("");
                })
                .Reorderable(reorder => reorder.Rows(true))
                .Events(e=>e.RowReorder("AppendixRowReorder"))
                .ToolBar(toolbar => {
                    toolbar.Save();
                })
                .Editable(editable => editable.Mode(GridEditMode.InCell).DisplayDeleteConfirmation(false))
                 .DataSource(dataSource => dataSource
                    .Ajax().Batch(true)
                    .Model(m =>
                    {
                        m.Id(e => e.DocumentAppendixId);
                        m.Field(e => e.FileDescription).Editable(true);
                        m.Field(e => e.IsDownload).Editable(false);

                    })
                    .Events(events =>
                    {
                        events.Error("error_handler").Change("AppendixChange");
                    })
                    .Model(model => model.Id(p => p.DocumentAppendixId))
                    .Read(r => r.Action("Get", "Order", new { totalCashCalculationId = totalCashCalculationId, langCode = langCode, brand=brand }))
                    .Update(update => update.Action("EditingXYX_Update", "Order").Type(HttpVerbs.Post))
                    .Destroy(d => d.Action("EditingXYX_Destroy", "Order").Type(HttpVerbs.Post))
                        )
                        )

                    @Html.HiddenFor(m => m.fileuploaded, new { id = "hdnUploadedFile" })

4. On Save button click we are calling below method .

$('#GridAppendixDocuments').data('kendoGrid').saveChanges();

5. On the controller we are using verb .

[AcceptVerbs("Post")]
Please share some solutions.
Ivan Danchev
Telerik team
commented on 12 Jun 2025, 12:32 PM

Shreesh,

Thank you for the additional information provided.

Could you post the EditingXYX_Destroy and EditingXYX_Update actions?

Additionally, please clarify how you've handled the Save button click event, because you mention calling the Grid's saveChanges() method on clicking the button, but it is not clear how the click handler is attached to the Save button.

In general, if there are any changes in the Grid's rows, clicking the Save button will automatically trigger the request to the respective action. So calling saveChanges() is not needed. 

harry
Top achievements
Rank 1
commented on 16 Jun 2025, 12:47 PM

Given that your Read method is still working, it strongly suggests the issue lies specifically with how the Update and Destroy operations are configured or how the data is being sent/received in the latest Kendo UI version.

papa's games

No answers yet. Maybe you can help?

Tags
Getting started with ASP.NET
Asked by
Shreesh
Top achievements
Rank 1
Share this question
or