Reloading ajax grid with post data
Name Surname Marital status Time stamp
Joe Crosswave Married 11/21/2024 6:29:19 AM
Merry Lisel Widowed 11/21/2024 6:29:19 AM
Henry Crux Single 11/21/2024 6:29:19 AM
Cody Jurut 11/21/2024 6:29:19 AM
Simon Scranton Single 11/21/2024 6:29:19 AM
Leena Laurent Divorced 11/21/2024 6:29:19 AM
Ode Cosmides Married 11/21/2024 6:29:19 AM
Diandra Mizner Single 11/21/2024 6:29:19 AM
Pete Cassel Married 11/21/2024 6:29:19 AM
Nicky Tremblay Married 11/21/2024 6:29:19 AM
Controller

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

[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post)]
public PartialViewResult IndexGrid(String name)
{
    return PartialView("_IndexGrid", repository.Filter(name));
}

Javascript

document.getElementById('ContentRefresh').addEventListener('click', function () {
    var grid = new MvcGrid(document.querySelector('.mvc-grid'));
    grid.requestType = 'post'; // defaults to get
    grid.query.set('name', 'Joe');

    grid.reload();
});

Main view

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

Ajax grid 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");
    })
)