Binding grid reload events
Name Surname Marital status Time stamp
Joe Crosswave Married 11/11/2019 7:35:23 PM
Merry Lisel Widowed 11/11/2019 7:35:23 PM
Henry Crux Single 11/11/2019 7:35:23 PM
Cody Jurut 11/11/2019 7:35:23 PM
Simon Scranton Single 11/11/2019 7:35:23 PM
Leena Laurent Divorced 11/11/2019 7:35:23 PM
Ode Cosmides Married 11/11/2019 7:35:23 PM
Diandra Mizner Single 11/11/2019 7:35:23 PM
Pete Cassel Married 11/11/2019 7:35:23 PM
Nicky Tremblay Married 11/11/2019 7:35:23 PM
Main view

@Html.AjaxGrid(Url.Action("IndexGrid"))

_IndexGrid partial view

@model IEnumerable<Person>

@* Should only include grid declaration *@

@(Html
    .Grid(Model)
    .Build(columns =>
    {
        columns.Add(model => model.Name).Titled("Name");
        columns.Add(model => model.Surname).Titled("Surname");
        columns.Add(model => model.MaritalStatus).Titled("Marital status");

        columns.Add(model => DateTime.Now).Titled("Time stamp");
    })
)

Javascript

document.addEventListener('reloadstart', function (e) {
    console.log('grid: ', e.detail.grid);
});

document.addEventListener('reloadend', function (e) {
    console.log('grid: ', e.detail.grid);
});

document.addEventListener('reloadfail', function (e) {
    console.log('grid: ', e.detail.grid);
    console.log('failed ajax response result: ', e.detail.result);
});

Controller

[HttpGet]
public ViewResult Index()
{
    return View();
}

[HttpGet]
public PartialViewResult IndexGrid()
{
    return PartialView("_IndexGrid", repository.GetPeople());
}