Asp.net mvc 使用剑道调度程序的问题
我已经使用剑道控件有一段时间了,它们包含在HTML/Razor网页上相当简单:下面是一些工作示例:Asp.net mvc 使用剑道调度程序的问题,asp.net-mvc,razor,kendo-ui,telerik,kendo-scheduler,Asp.net Mvc,Razor,Kendo Ui,Telerik,Kendo Scheduler,我已经使用剑道控件有一段时间了,它们包含在HTML/Razor网页上相当简单:下面是一些工作示例: @(Html.Kendo().Grid<ProjectName.Models.MyModel>() ... @(Html.Kendo().DropDownList() ... @(Html.Kendo().Button() ... @(Html.Kendo().Grid()) ... @(Html.Kendo().DropDownList()) ... @(Html.Kendo(
@(Html.Kendo().Grid<ProjectName.Models.MyModel>()
...
@(Html.Kendo().DropDownList()
...
@(Html.Kendo().Button()
...
@(Html.Kendo().Grid())
...
@(Html.Kendo().DropDownList())
...
@(Html.Kendo().Button())
...
我想开始使用,在他们的示例中,他们有:
@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.TaskViewModel>()
@(Html.Kendo().Scheduler())
所以我试了一下:
@(Html.Kendo().Scheduler<ProjectName.Models.MyModel>()
@(Html.Kendo().Scheduler())
但它在编辑器中显示了此错误:
命名空间ProjectName.Models.MyModel错误:
类型“ProjectName.Models.MyModel”不能用作泛型类型或方法“Kendo.Mvc.UI.Fluent.WidgetFactory.Scheduler()”中的类型参数“T”。没有从“ProjectName.Models.MyModel”到“Kendo.Mvc.UI.IsSchedulerEvent”的隐式引用转换
我做错了什么?绑定到计划程序的模型必须从“IsScheduleEvent”接口继承。此接口存在于“Kendo.Mvc.UI”命名空间中。例如
// ViewModel required for managing appointments
public class SchedulerViewModel : ISchedulerEvent
{
public string Title { get; set; }
public string Description { get; set; }
public bool IsAllDay { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
public string StartTimezone { get; set; }
public string EndTimezone { get; set; }
public string RecurrenceRule { get; set; }
public string RecurrenceException { get; set; }
//Add your own property here
}
希望这能解决错误。您有继承
isScheduleEvent
接口的模型的示例吗?我在回答中添加了一个继承isScheduleEvent的viewmodel示例。谢谢!调度器现在显示,但其中没有数据…+1。您能帮助将数据绑定到它吗?当然。发布代码您用于将数据绑定到计划程序的。否则,我们可以在hangout中讨论“satyaranjan219@gmail.com“。具体问题,希望你能帮忙!