This is a migrated thread and some comments may be shown as answers.

Problem with datasource

1 Answer 98 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Aldo
Top achievements
Rank 2
Aldo asked on 26 Jul 2013, 03:32 PM

Hi,  I'm trying to implement Scheduler in a MVC4 Razor project...
I follow the sample in your project, but i can't make appointment show.
Post some code:

public ActionResult Gantt()
{
    ViewBag.Message = "GANTT";
 
    return View(ganttService.GetGantt());
}
 
public virtual JsonResult Read([DataSourceRequest] DataSourceRequest request)
{
    return Json(ganttService.GetGantt());
}

 

public class GanttViewModel : ISchedulerEvent
   {
       public string Description
       {
           get;
           set;
       }
 
       public DateTime End
       {
           get;
           set;
       }
 
       public bool IsAllDay
       {
           get;
           set;
       }
 
       public string RecurrenceException
       {
           get;
           set;
       }
 
       public string RecurrenceRule
       {
           get;
           set;
       }
 
       public DateTime Start
       {
           get;
           set;
       }
 
       public string Title
       {
           get;
           set;
       }
   }

 

public virtual IQueryable<GanttViewModel> GetGantt()
{
    List<GanttViewModel> retValue = new List<GanttViewModel>();
 
    GanttViewModel md1 = new GanttViewModel {  Title = "TIT1", Description = "DES1", Start = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc), End = DateTime.SpecifyKind(DateTime.Now.AddHours(3), DateTimeKind.Utc) };
 
    retValue.Add(md1);
 
    return (retValue.AsQueryable());
}
@(Html.Kendo().Scheduler<
FinitenessEvo.Models.GanttViewModel>()
    .Name("scheduler")
    .Date(DateTime.Today)
    .StartTime(DateTime.Today)
    .Height(600)   
    .Timezone("Etc/UTC")
    .Views(views =>
    {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
        views.AgendaView();
    })
        .DataSource(o => o.Model(m => { m.Id(f => f.Description); }).Read("Read","Home"))
)

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 30 Jul 2013, 06:23 AM
Hello Aldo,

I'm afraid that it is not obvious what may be the cause for such behavior looking at the provided details. Therefore, could you please check if there are any errors on the page as well as the status of the read request (is it successful and is data returned by the controller action). Also you should verify that the DataSource Read configuration does match the actual controller.

Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Scheduler
Asked by
Aldo
Top achievements
Rank 2
Answers by
Rosen
Telerik team
Share this question
or