I'm trying to bind the ASP.NET Core Grid control to the enumerable view model on the page, e.g.
@model IEnumerable<SyncFusionTests.Web.Models.BeneficialOwnerIndexModel>
All the examples appear to be binding to a rest end point, however the documentation states:
You can bind the data to Grid control by either locally or remotely. Assign the remote service URL to e-datamanager
property of Grid control to bind remote data using ej.DataManager
.
But with no examples on how to bind locally.
How would I achieve this?
I've even tried defining the grid data source as:
<e-datamanager url="Home/DataSource" offline="true"></e-datamanager>
With the associated method in the controller:
public ActionResult DataSource(Syncfusion.JavaScript.DataManager dm)
{
var DataSource = GetDummyBeneficialOwnersList();
DataResult result = new DataResult();
result.result = DataSource.Skip(dm.Skip).Take(dm.Take).ToList();
result.count = DataSource.Count();
return Json(result);
}
But this didn't work either.
Preferably I'd like to be able to attach to the model associated with the page.
Thanks in advance,
Stuart.