Grouping schedule by using a property in VM

1 Answer 91 Views
Scheduler
Saparamadu
Top achievements
Rank 1
Saparamadu asked on 15 May 2022, 10:51 AM

Hi,

May I know, Is there any way to group scheduler by using a property that declared in the ViewModel without using and declaring resources as below?

 

@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.MeetingViewModel>()
    .Name("scheduler")
    .Date(new DateTime(2013613))
    .StartTime(new DateTime(201361370000))
    .Height(600)
    .Views(views =>
    {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
        views.TimelineView();
    })

    .Timezone("Etc/UTC")

 

    .Group(group => group.Resources("RoomId"))
    
    .DataSource(d => d
            .Model(m =>
            {
                m.Id(f => f.MeetingID);
                m.Field(f => f.Title).DefaultValue("No title");
                m.RecurrenceId(f => f.RecurrenceID);
            })
            .Read("Grouping_Horizontal_Read""Scheduler")
            .Create("Grouping_Horizontal_Create""Scheduler")
            .Destroy("Grouping_Horizontal_Destroy""Scheduler")
            .Update("Grouping_Horizontal_Update""Scheduler")
    )

)

 

Thank you.

Chandrasiri


1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 18 May 2022, 11:56 AM

Hello Saparamadu,

Indeed, it is not required to define Resources in the Scheduler configuration, and you can group the events by the Date property as per the example below:

@(Html.Kendo().Scheduler<MeetingViewModel>()
  .Name("scheduler")
  .Group(gr => gr.Date(true))
  ...
)

Check out the available options of the Group() method:

https://docs.telerik.com/aspnet-core/api/Kendo.Mvc.UI.Fluent/SchedulerGroupBuilder#datesystemboolean

If any other questions arise, please share them.

 

Regards, Mihaela 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
Saparamadu
Top achievements
Rank 1
Answers by
Mihaela
Telerik team
Share this question
or