Binding grid reload events
Name Surname Marital status Time stamp
Joe Crosswave Married 1/18/2025 1:49:03 AM
Merry Lisel Widowed 1/18/2025 1:49:03 AM
Henry Crux Single 1/18/2025 1:49:03 AM
Cody Jurut 1/18/2025 1:49:03 AM
Simon Scranton Single 1/18/2025 1:49:03 AM
Leena Laurent Divorced 1/18/2025 1:49:03 AM
Ode Cosmides Married 1/18/2025 1:49:03 AM
Diandra Mizner Single 1/18/2025 1:49:03 AM
Pete Cassel Married 1/18/2025 1:49:03 AM
Nicky Tremblay Married 1/18/2025 1:49:03 AM
Main view

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

_IndexGrid partial view

@model IQueryable<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());
}