Hello.
I'm using VS 2017 MVC .net Core Entity Framework Core. The data is not binding. I suspect maybe I need to reference something else in the DataSource.
I've Design First reverse engineered my models and add controller to create the scaffolding (CRUD) pages.
Now I have a table that is looping and building a grid, and I'm replacing it with Syncfusion GRID.
This is my Controler:
public TblContractzsController(ContractsContext context)
{
_context = context;
}
// GET: TblContractzs
public async Task<IActionResult> Index()
{
return View(await _context.TblContractz.ToListAsync());
//ViewBag.datasource = _context.TblContractz.ToList();
//return View();
}
This is my View:
<ejs-grid id="Grid" Datasource="ViewBag.datasource" allowPaging="true">
<e-grid-columns>
<e-grid-column field="ContractName" headerText="Contract Name" textAlign="Right" width="120"></e-grid-column>
</e-grid-columns>
</ejs-grid>