Trying to pull dat from controller to a simple grid as a learning curve for Syncfusion MVC grid, page shoew no data yet the controller has two records in the action Result
Controller:
public ActionResult Index()
{
var leagues = db.Leagues.Include(l => l.Group).Include(l => l.User).Include(l => l.User1).ToList()
.Select(l => new League
{
LeagueID=l.LeagueID,
LeagueName=l.LeagueName
});
ViewBag.datasource = leagues.ToList();
return View();
}
Razor:
@(Html.EJ().Grid<League>("leagues")
.Datasource((IEnumerable<object>)ViewBag.leagues)
.Columns(col =>
{
col.Field("LeagueID").IsPrimaryKey(true).HeaderText("ID").Add();
col.Field("LeagueName").HeaderText("League").Add();
})
)
there are no JS errors in the console, any pointers
G