All,
I am having a heck of a time with a very basic implementation using custom Ajax binding.
My implementation is extremely simple. I have verified that the JSON result is returned as CamalCase (Hence the KendoSerializerSettings).
Please see below.
Controller
public
ActionResult YearRead([DataSourceRequest]DataSourceRequest request)
{
IEnumerable<VehMetaYearDto> years = _metaService.GetYears();
DataSourceResult result = years.ToDataSourceResult(request);
return
Json(result, KendoSerializerSettings);
}
JSON Result
{
"Result": {
"Data": [
{
"Year": 2017,
"IsDeleted": false,
"DeleterUserId": null,
"DeletionTime": null,
"LastModificationTime": null,
"LastModifierUserId": null,
"CreationTime": "2018-10-30T12:15:48.1414343",
"CreatorUserId": null,
"Id": 1
},
{
"Year": 2016,
"IsDeleted": false,
"DeleterUserId": null,
"DeletionTime": null,
"LastModificationTime": null,
"LastModifierUserId": null,
"CreationTime": "2018-10-31T08:14:16.9153819",
"CreatorUserId": null,
"Id": 2
}
],
"Total": 2,
"AggregateResults": null,
"Errors": null
},
"TargetUrl": null,
"Success": true,
"Error": null,
"UnAuthorizedRequest": false,
"__abp": true
}
Razor
@(Html.Kendo().Grid<
VehMetaYearDto
>()
.Name("YearGrid")
.Columns(c =>
{
c.Bound(x => x.Year);
})
.DataSource(d => d
.Ajax()
.Read(r => r.Action("YearRead", "VehMetaAdmin"))
)
)
The grid renders blank sadly.
PS - The code formatting for this forum is very difficult to use