First time using MVC and Kendo Scheduler and I can't get the data to show on the Calendar. I have the below Model
public class Events : ISchedulerEvent
{
public int Id { get; set; }
public string Description { get; set; }
public DateTime End { get; set; }
public string EndTimezone { get; set; }
public bool IsAllDay { get; set; }
public string RecurrenceException { get; set; }
public string RecurrenceRule { get; set; }
public DateTime Start { get; set; }
public string StartTimezone { get; set; }
public string Title { get; set; }
}
My Controller just simply creates an instance of this class and adds data to it and returns a list as so:
public ActionResult Index()
{
return View(GetAll());
}
public List<Events> GetAll()
{
var p = new List<Events>();
p.Add(new Events
{
Id = 1,
Title = "Board Meeting",
Start = DateTime.Now,
End = DateTime.Now.AddHours(2)
});
return p;
}
My view is simply this:
@using Kendo.Mvc.UI;
@(Html.Kendo().Scheduler<Optic.Models.Calendar.Events>()
.Name("scheduler")
.Date(new DateTime(2014, 1, 22))
.StartTime(new DateTime(2013, 6, 13, 07, 00, 00))
.EndTime(new DateTime(2013, 6, 13, 21, 00, 00))
.Editable(false)
.Height(600)
.Views(views =>
{
views.DayView();
views.WeekView();
views.MonthView(month => month.Selected(true));
views.AgendaView();
})
.DataSource(d => d
.Model(m => m.Id(f => f.Id))
)
.BindTo(Model)
)
The calendar loads and switching from day to month and so on works, but no data will populate in the calendar. I've checked the model and it does have data. Is there something I am missing in order to get the data to show on the calendar? Any help would be greatly appreciated.