Using asp.net MVC 3, is it possible to bind a collection of interfaces to a Kendo Grid instead of a concrete class? For example:
Controller
View
When binding directly to IEnumerable<IFoo>, the following exception is raised:
Using the Kendo Grid, are we constrained to using concrete types for everything? Or is there a way to use an interfaces?
Thanks!
Controller
IEnumerable<IFoo> items = repo.GetFoo();
return
View( items );
View
@model IEnumerable<
IFoo
>
@Html.Kendo().Grid(Model).Name("Grid").Columns(column =>
{
column.Bound(c => c.Name).Title("Foo Name");
column.Bound(c => c.Key).Title("Foo Key");
}).DataSource(dataSource => dataSource.Ajax().ServerOperation(false))
When binding directly to IEnumerable<IFoo>, the following exception is raised:
Exception Details: System.MissingMethodException: Cannot create an instance of an interface.
Source Error:
Line 7: @Html.Kendo().Grid(Model).Name("Grid").Columns(column =>
Using the Kendo Grid, are we constrained to using concrete types for everything? Or is there a way to use an interfaces?
Thanks!