Grid destroy confirmation event to trigger ActionResult

4 posts, 1 answers
  1. Paul
    Paul avatar
    9 posts
    Member since:
    Sep 2016

    Posted 01 Nov 2016 Link to this post

    My aim is to delete the row when the Command Destroy column is clicked if the built in Confirmation popup if confirmed.

    Want: Click Destroy Column > Confirm OK > ActionReult Triggered

    Cannot use auto-sync since aiming at keeping other updates and inserts still require the save to be clicked to commit.


    Currently the code will remove the row from the display when it is clicked as is built in.

    And only after the save button for the grid is clicked does it trigger the ActionResult "OfficerDestroy" for doing so.


    Seems there should be some event in this process that could trigger the ActionResult.

    What are the options here for triggering that ActionResult while having a confirmation?


        .Columns(c => {
            c.Bound(vm => vm.GridId); //Can display for testing purposes
            c.Bound(vm => vm.FirstName).Width(50);
            c.Bound(vm => vm.LastName).Width(50);
            c.Bound(vm => vm.Title).Width(50);
            c.Command(command => { command.Destroy(); }).Width(30);
        .Editable(editable => editable.Mode(GridEditMode.InCell))
        .DataSource(dataSource => dataSource
            .Events(events => events.Error("officerGrid_error") // Handle the "error" event
                .RequestEnd("officerGrid_RequestEnd") // Handle the "RequestEnd" event
            .Model(model => model.Id(vm => vm.GridId))
            .Create("OfficerCreate", "Wizard")
            .Read("OfficerRead", "Wizard")
            .Update("OfficerUpdate", "Wizard")
            .Destroy("OfficerDestroy", "Wizard")//.AutoSync(true)


    function officerGrid_RequestEnd(e) {
            if (e.type == "update" || e.type == "create") {

    public ActionResult OfficerDestroy([DataSourceRequest] DataSourceRequest request, IEnumerable<gridData> models)
    {//This code works fine

  2. Pavlina
    Pavlina avatar
    6187 posts

    Posted 03 Nov 2016 Link to this post


    I suggest you go through this forum thread where my colleague Dimiter provided several options for achieving similar requirement. You can use built in Grid delete confirmation window, or disable it and display a custom confirmation window as described in the post below:

    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
  3. Paul
    Paul avatar
    9 posts
    Member since:
    Sep 2016

    Posted 03 Nov 2016 Link to this post

    Looking at the examples it seems like:

    The custom commands are only triggering in page script actions for changing the display and not an ActionResult in the controller.

    And the one that has mention of ActionResult triggering is using the GridEditMode.InLine


    Using the code reference examples I can make a custom command that removes a row from the displaying grid with a confirmation popup; though this is all on the display level and does not trigger the ActionResult.


    Maybe I'm missing something but these examples do not seem to address how to:

    Trigger an ActionResult using a confirmation in InCell mode.

  4. Answer
    Pavlina avatar
    6187 posts

    Posted 02 Dec 2016 Link to this post


    When using InCell edit mode, all of the changes will be send when Save Changes button is clicked. This is same for updating, creating as well as deleting records. Thus, when delete button is click the record is only marked as deleted, but the actual call to the server will happen when  the DataSource is sync by clicking on the Save Changes button.

    Telerik by Progress
    Telerik UI for ASP.NET MVC is ready for Visual Studio 2017 RC! Learn more.
Back to Top