Scheduler Custom DataSource

3 posts, 0 answers
  1. mabs
    mabs avatar
    57 posts
    Member since:
    May 2010

    Posted 08 Nov Link to this post

    I am currently trying to initialise the Kendo schedular in MVC (VB.Net).  I am getting the following error;

    'Schema' is not a member of 'Kendo.Mvc.UI.Fluent.SchedulerAjaxDataSourceBuilder(Of TPinvestor.Models.ViewModels.PersonalFinanceManagement.SchedulerEvent)

    which is in relation to line 15 below.

     

    01.@Code
    02.    Html.Kendo().Scheduler(Of Models.ViewModels.PersonalFinanceManagement.SchedulerEvent)() _
    03.        .Name("scheduler") _
    04.        .Date(New DateTime(2013, 6, 6)) _
    05.        .StartTime(New DateTime(2013, 6, 6, 7, 0, 0)) _
    06.        .AllDaySlot(False) _
    07.        .Views(Sub(views)
    08.                       views.DayView()
    09.                       views.MonthView(Function(monthView) monthView.Selected(True))
    10.               End Sub) _
    11.        .Editable(True) _
    12.        .DataSource(Sub(d)
    13.                            d.Custom()
    14.                            d.Batch(True)
    15.                            d.Schema(Function(schema)
    16.                                             schema.Model(Sub(m)
    17.                                                                  m.Id(Function(f) f.Id)
    18.                                                                  m.Field("title", GetType(String)).DefaultValue("No Title").From("Title")
    19.                                                                  m.Field("description", GetType(String)).From("Description")
    20.                                                                  m.Field("start", GetType(String)).From("Start")
    21.                                                                  m.Field("end", GetType(String)).From("End")
    22.                                                          End Sub)
    23.                                     End Function)
    24.                    End Sub) _
    25.        .Render()
    26. 
    27. 
    28.End Code

     

    I have created a viewmodel that implements Kendo.Mvc.UI.ISchedulerEvent.  I have added no additional properties.  

    Any help would be much appreciated.

  2. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 09 Nov Link to this post

    Hi,

    You have to chain the function calls to each other's result, instead of calling them all on the "d" parameter. Here's how it should look:
    d.Custom() _
    .Batch(True) _
    .Schema(Sub(Schema)
    ...


    Regards,
    Bozhidar
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. mabs
    mabs avatar
    57 posts
    Member since:
    May 2010

    Posted 09 Nov in reply to Bozhidar Link to this post

    That is great thank you.
Back to Top