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

Scheduler Custom DataSource

2 Answers 118 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
mabs
Top achievements
Rank 1
mabs asked on 08 Nov 2016, 09:06 AM

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 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 09 Nov 2016, 07:47 AM
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.
0
mabs
Top achievements
Rank 1
answered on 09 Nov 2016, 08:18 AM
That is great thank you.
Tags
Scheduler
Asked by
mabs
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
mabs
Top achievements
Rank 1
Share this question
or