| Name | Surname | Marital status | Time stamp |
|---|---|---|---|
| Joe | Crosswave | Married | 11/16/2025 2:19:46 PM |
| Merry | Lisel | Widowed | 11/16/2025 2:19:46 PM |
| Henry | Crux | Single | 11/16/2025 2:19:46 PM |
| Cody | Jurut | 11/16/2025 2:19:46 PM | |
| Simon | Scranton | Single | 11/16/2025 2:19:46 PM |
| Leena | Laurent | Divorced | 11/16/2025 2:19:46 PM |
| Ode | Cosmides | Married | 11/16/2025 2:19:46 PM |
| Diandra | Mizner | Single | 11/16/2025 2:19:46 PM |
| Pete | Cassel | Married | 11/16/2025 2:19:46 PM |
| Nicky | Tremblay | Married | 11/16/2025 2:19:46 PM |
[HttpGet]
public ViewResult Index()
{
return View();
}
[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post)]
public PartialViewResult IndexGrid(String name)
{
return PartialView("_IndexGrid", repository.Filter(name));
}
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();
});
@Html.AjaxGrid(Url.Action("IndexGrid"))
@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");
})
)