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

Alter display based on view (day/week/month)

1 Answer 67 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
BR Developer
Top achievements
Rank 1
BR Developer asked on 25 Mar 2020, 05:58 PM
We have around 15 rooms in our building and we are using the Scheduler to show the room bookings. I'm using the resources feature to group by RoomID and show the calendar by Room. It works fine and displays correctly in the Day view but since there are 15 rooms, the week/month views are cramped so I was wondering if I can use the resources feature and grouping for the Day view and remove them for the Week/Month views. Is that possible? 
 
@(Html.Kendo().Scheduler<SchedulerViewModel>()
          .Name("Scheduler")
          .Date(DateTime.Today)
          .AllDaySlot(true)
          .Group(g => g.Resources("RoomID").Date(true))
          .Editable(w => w.Update(false).Create(false).Destroy(false))
          .Views(views =>
          {
              views.DayView(weekView => weekView.StartTime(06, 00, 00).EndTime(19, 00, 00).Selected(true));
              views.WeekView(weekView => weekView.StartTime(06, 00, 00).EndTime(19, 00, 00));
          })
          .AutoBind(false)
          .Resources(resource =>
          {
              resource.Add(m => m.RoomID)
              .DataTextField("Text")
              .DataValueField("Value")
            .DataSource(d => d.Read(read => read.Action("GetRooms", "DataSource")));
          })
          .DataSource(d => d
              .Model(m =>
              {
                  m.Id(f => f.RoomID);
                  m.Id(f => f.Id);
                  m.Field(f => f.Start);
                  m.Field(f => f.End);
              })
              .Read(read =>
              read.Action("GetCalendarSchedule", "DataSource")
              )
          ))
)

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 27 Mar 2020, 04:45 PM

Hi,

The Scheduler supports enabling grouping per view, instead of enabling it for the scheduler and then disabling it per view. Thus, enabling grouping only for Day View will result in the desired behavior:

        views.DayView(day => day.Groups(g => g.Resources("RoomID").Date(true)));
        views.MonthView();

Feel free to contact us again, if you have any questions.

Regards,
Dimitar
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Scheduler
Asked by
BR Developer
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or