Actually I figured it out what I was doing wrong. In the view under .DataSources(d => d.. blah blah blah, I needed to add a .Read("GetAll", "ControllerName"). In the Controller I then needed to add the Read Method with a Json(e.ToDataSourceResult(request), JsonRequestBehavior.AllGet); as shown below. I also needed to take out the code in the Index action result. Took care of the issue. See changes below:
View
@using Kendo.Mvc.UI;
@model List<Optic.Models.Scheduling.Events>
@(Html.Kendo().Scheduler<Optic.Models.Scheduling.Events>()
.Name("scheduler")
.Date(new DateTime(2014, 1, 22))
.StartTime(new DateTime(2013, 6, 13, 07, 00, 00))
.EndTime(new DateTime(2013, 6, 13, 23, 00, 00))
.Editable(false)
.Height(600)
.Views(views =>
{
views.DayView();
views.WeekView(week => week.Selected(true));
views.MonthView();
views.AgendaView();
})
.DataSource(d => d
.Model(m => m.Id(f => f.Id))
.Read("GetAll", "Scheduling")
)
.BindTo(Model)
)
Controller
public class SchedulingController : Controller
{
//
// GET: /Scheduling/
public ActionResult Index()
{
return View();
}
public JsonResult GetAll([DataSourceRequest] DataSourceRequest request)
{
var e = new List<Events>
{
new Events
{
Id =1,
Title="Testing 1",
Start= DateTime.Now.AddHours(1),
End = DateTime.Now.AddHours(2),
IsAllDay = false
},
new Events
{
Id=2,
Title="Testing 2",
Start = DateTime.Now.AddHours(3),
End = DateTime.Now.AddHours(4),
IsAllDay = false
}
};
return Json(e.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
}