I'm attempting to test out how the Telerik (Kendo) grid will work in a current application I have but am running into some roadblocks.
I have a WebApi controller which inherits from ApiController and implements the following "Get" method:
[System.Web.Http.HttpGet, System.Web.Http.Route(LookupUrl.MyLookup)] public DataSourceResult Get([System.Web.Http.ModelBinding.ModelBinder(typeof(WebApiDataSourceRequestModelBinder))]DataSourceRequest request)
{
return service.GetModels().ToDataSourceResult(request);
}
and in the .cshtml file I have:
@(Html.Kendo().Grid<MyModel>() .Name("telerikGrid") .Columns(col => { col.Bound(c => c.Key); col.Bound(c => c.DisplayName); col.Bound(c => c.Inactive); }) .Scrollable() .Groupable() .Sortable() .Filterable() .Pageable(pageable => pageable .Refresh(true) .PageSizes(true) .ButtonCount(5)) .DataSource(d => d.WebApi() .Model(model => { model.Id(p => p.Key); }) .Events(events => events.Error("error_handler")) .Read(read => read.Url(Url.ApiUrl(LookupUrl.MyLookup))) ) )
The grid shows up correctly on the page, but the controller method is never accessed. I'm not entirely sure what I am doing wrong here.