I'm trying to work the new preview version for .net core 1.0. However, the issue I'm having is that the grids will not display any data when using the MVC version. If I create the grid using the javascript version, it works.
Both grids call the same function and both return data. However, only Grid2 displays any data.
Using the KendoUI Chrome plugin, the Kendo Linter gives me two errors on Grid1.
http://localhost:20504/:92,944 Unknown option: prefix
http://localhost:20504/:92,1146 Unknown option: fields
Also, inspecting the grid, the _data for Grid1 shows Array[0], while the _data for Grid2 shows Array[1].
<
h1
>Grid 1</
h1
>
@(Html.Kendo().Grid<
TelerikCoreTest1.Model.GridModel
>()
.Name("Grid1")
.Columns(col =>
{
col.Bound(x => x.Id);
col.Bound(x => x.Text);
})
.DataSource(ds => ds
.Ajax()
.Read(rd => rd.Action("Grid_Read", "Home"))
)
.Deferred()
)
<
br
/>
<
h1
>Grid 2</
h1
>
<
div
id
=
"Grid2"
></
div
>
@section scripts {
<
script
>
var readUrl = '@Url.Action("Grid_Read", "Home")'
$("#Grid2").kendoGrid({
height: 400,
columns: [{ title: "Id", field: "id" },
{title: "Text", field: "text"}
],
dataSource: {
transport: {
read: readUrl
},
schema: {
data: "data"
}
}
});
</
script
>
@Html.Kendo().DeferredScripts()
}
public
IActionResult Grid_Read([DataSourceRequest]DataSourceRequest request)
{
List<GridModel> data =
new
List<Model.GridModel>();
GridModel gm =
new
GridModel()
{
Id = 1,
Text =
"Testing"
};
data.Add(gm);
return
Json(data.ToDataSourceResult(request));
}