I am using Telerik 2021.1.422
I get a successful response using my url /shuttlelocation/get
{"data":[{"accountId":933080580393897320,"routeLocationId":"26bcb4b3-0226-4de3-9e65-de878ade40e8","name":"Nelspruit","address1":"Address 1","address2":"Address 2","address3":"Address 3","address4":"Address 4","latitude":1000,"longitude":2000,"isActive":true,"createdOn":"2022-12-09T15:14:37.133289+02:00","userId":"972c57b3-2996-43f2-9336-890750dfa7f8","userName":"Anton Swanevelder"},{"accountId":933080580393897320,"routeLocationId":"0f9b89c2-4bcc-4744-a833-29a615e07417","name":"Potchefstroom","address1":"Potchefstroom","address2":"Bult","address3":"Shell Garage","address4":null,"latitude":1000.00,"longitude":2000.00,"isActive":true,"createdOn":"0001-01-01T00:00:00+00:00","userId":"972c57b3-2996-43f2-9336-890750dfa7f8","userName":"Anton Swanevelder"}],"total":2,"aggregateResults":null,"errors":null}
But my grid remain empty
There are no errors in the browser
Here is the Controller Get. The Repository returns an IQueryable
public JsonResult Get([DataSourceRequest] DataSourceRequest request)
{
var data = _routeLocations.GetLocationsBySearch(string.Empty);
return this.Json(data.ToDataSourceResult(request));
}
Here is the View
@(Html.Kendo().Grid<RouteLocationModel>()
.Name("grid")
.Columns(c => {
c.Bound(p => p.Name);
c.Bound(p => p.Address1);
c.Bound(p => p.Latitude);
c.Bound(p => p.IsActive);
c.Command(c =>
{
c.Edit(); // The "edit" command will edit and update data items.
c.Destroy(); // The "destroy" command removes data items.
}).Title("Commands").Width(200);
})
.ToolBar(toolbar => toolbar.Create().Text("Add Location").HtmlAttributes(new { @class="" }))
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.DataSource(d => d
.Ajax()
.Read(r => r.Action("Get", "ShuttleLocation"))
.PageSize(50)
.Model(model => {
model.Id(p => p.RouteLocationId);
})
)
.Pageable()
.Sortable()
.Filterable()
)