ASP.NET MVC Scheduler - Remove / hide / make go away the time rows and All day header but keep custom resource vertical grouping

1 Answer 424 Views
Scheduler
Attila
Top achievements
Rank 1
Iron
Iron
Attila asked on 21 Jun 2021, 01:23 PM

Hi

I am trying to create a vertical grouping based on the data from our db.

The usecase is to show a continuous event spanning whatever start and end time, for each Room (the duplicate is a db issue so nevermind that). So i dont want the time rows, and would like to remove them permanently. 

I attached some screenshot of what i want it to look like (ish), also done with telerik schedule, but in WPF. 

And an image of what my attempt looks like in mvc.

Heres my mvc razor code:

@model IList<WebStaffScreen.Models.TaskViewModel>
@using Kendo.Mvc.UI

@(Html.Kendo().Scheduler<WebStaffScreen.Models.TaskViewModel>()
	.Name("booking_scheduler")
	.DateHeaderTemplate("<span class='k-link k-nav-day'>#= kendo.toString(date, 'dd-MM-yyyy') #</span>")
	.Date(DateTime.Now)
	.StartTime(DateTime.Now)
	.CurrentTimeMarker(false)
	.AllDaySlot(true)
	.Views(v => {
		v.WeekView(x => x.Selected(true));
		v.TimelineView();
	})
	.Timezone("Etc/UTC")
	.Group(g => g.Resources("Rooms").Orientation(SchedulerGroupOrientation.Vertical))
	.Resources(r => r.Add(m => m.RoomID)
		.Title("Room")
		.Name("Rooms")
		.DataTextField("RoomName")
		.DataValueField("RoomID")
		.DataColorField("AppointmentColor")
		.BindTo(Model)
		.DataSource(d => { d.Custom().Transport(t => t.Read(x => x.Action("GetRoomsInResidence", "Booking"))).Schema(s => s.Model(m => { m.Id("RoomID"); m.Field("RoomName", typeof(string)); })); })
	)
	.DataSource(d => d
		.Model(m => {
			m.Id(f => f.TaskID);
			m.Field(f => f.Title).Editable(false);
			m.Field(f => f.Start).Editable(false);
			m.Field(f => f.End).Editable(false);
		})
		.Read("Read", "Booking")
		.Create("Create", "Booking")
		.Update("Update", "Booking")
		.Destroy("Destroy", "Booking")
	)
)

The data finally comes out and it creates the rows (except for the colors), and adds them to the correct resource group's all day row.. But all the rows with time needs to go away, because its simply not needed for this particular scheduler view.

Can you please help?

1 Answer, 1 is accepted

Sort by
0
Accepted
Attila
Top achievements
Rank 1
Iron
Iron
answered on 22 Jun 2021, 06:48 AM

-.- 

I feel foolish... i clicked the "Timeline" button for the first time, and it looks exactly the way i want it, (except the colors)..

So i solved my problem by removing the dayview and setting the timeline to default.

Tags
Scheduler
Asked by
Attila
Top achievements
Rank 1
Iron
Iron
Answers by
Attila
Top achievements
Rank 1
Iron
Iron
Share this question
or