I have been using Kendo controls for a while and their inclusion on HTML/Razor webpages is fairly simple: Here are some working examples:
@(Html.Kendo().Grid<ProjectName.Models.MyModel>()
...
@(Html.Kendo().DropDownList()
...
@(Html.Kendo().Button()
...
I want to start using the Kendo Scheduler and in their example they have this:
@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.TaskViewModel>()
So I tried this:
@(Html.Kendo().Scheduler<ProjectName.Models.MyModel>()
but it shows this error in the editor:
namespace ProjectName.Models.MyModel
Error:
The type 'ProjectName.Models.MyModel' cannot be used as type parameter 'T' in the generic type or method 'Kendo.Mvc.UI.Fluent.WidgetFactory.Scheduler()'. There is no implicit reference conversion from 'ProjectName.Models.MyModel' to 'Kendo.Mvc.UI.ISchedulerEvent'
What am I doing wrong?
The Model that you are binding to the scheduler must inherit from "ISchedulerEvent" interface. This interface is present in "Kendo.Mvc.UI" namespace. e.g.
Hope this will solve the error.