Based on the examples I've seen posted int he forum, it's possible to instantiate A DataGrid using Razor syntax. It doesn't seem to be working for me.
When I replace the working code above with the Razor syntax below, I get a blank page:
@{
var DataGrid = new Syncfusion.EJ2.Grids.Grid()
{
DataSource = "ViewBag.dataSource",
AllowPaging = false,
AllowSorting = false,
AllowResizing = false,
AllowFiltering = false,
AllowGrouping = false,
Toolbar = new List() { "Add", "Edit", "Delete", "Update", "Delete", "Cancel", "Search" },
EditSettings = new Syncfusion.EJ2.Grids.GridEditSettings() { AllowAdding = true, AllowEditing = true, AllowDeleting = true, Mode = Syncfusion.EJ2.Grids.EditMode.Normal},
Columns = new List {
new Syncfusion.EJ2.Grids.GridColumn(){ Field="TrainingID", HeaderText="ID", IsPrimaryKey=true },
new Syncfusion.EJ2.Grids.GridColumn(){ Field="Date", HeaderText="Date", EditType = "datepickeredit", Format="yDm"},
new Syncfusion.EJ2.Grids.GridColumn(){ Field="Type", HeaderText="Type" },
new Syncfusion.EJ2.Grids.GridColumn(){ Field="Modality", HeaderText="Modality" },
new Syncfusion.EJ2.Grids.GridColumn(){ Field="Description", HeaderText="Description" },
}
};
}