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

Multi Day events not receiving data in day view

2 Answers 17 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 24 Feb 2021, 04:00 PM

The multi day events in the month view render correctly and receive all the properties (color, link, title, etc) in the month view but do not get them in the day view. I'm getting the title of the item in the All Day table but am not getting the event color, or url. Single day items display correctly in both month and day view. 

@(Html.Kendo()
    .Scheduler<EventDetailViewModel>()
    .Name("schedule")
    .Editable(false)
    .Selectable(true)
    .Date(scheduleDate)
    .ShowWorkHours(false)
    .StartTime(new DateTime(scheduleDate.Year, scheduleDate.Month, scheduleDate.Day, 7, 00, 00))
    .EndTime(new DateTime(scheduleDate.Year, scheduleDate.Month, scheduleDate.Day, 22, 00, 00))
    .Views(views =>
    {
        views.MonthView();
        views.DayView();
    })
    .EventTemplateId("eventTemplate")
    .DataSource(d => d.Model(m =>
    {
        m.Field(f => f.EventID);
        m.Field(f => f.EventStartTime);
        m.Field(f => f.EventTitle);
        m.Field(f => f.EventCategory);
        m.Field(f => f.EventColor);
        m.Field(f => f.EventUrl);
    }))
    .BindTo(events)
    .Deferred(true)
)
 
<script id="eventTemplate" type="text/x-kendo-template">
        <a href="#= EventUrl #" class="calendar__link" title="#= EventTitle #" data-category="#= EventCategory #" data-color="#= EventColor #">
            <span class="calendar__title">#= EventTitle #</span>
            <span class="calendar__time">#= EventStartTime #</span>
        </a>
</script>

 

2 Answers, 1 is accepted

Sort by
0
Justin
Top achievements
Rank 1
answered on 25 Feb 2021, 05:41 PM

Fixed the issue by assigning the day view with .AllDayEventTemplateId.

 

views.DayView(dayView => dayView.AllDayEventTemplateId("eventTemplate"));
0
Ivan Danchev
Telerik team
answered on 01 Mar 2021, 02:27 PM

Hello Justin,

Yes, using the AllDayEventTemplateId option is the correct approach. The "month" view does not have an AllDay slot so this template does not have effect on it, but it must be set for the views that have an AllDay slot.

Regards,
Ivan Danchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Scheduler
Asked by
Justin
Top achievements
Rank 1
Answers by
Justin
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or