SchedulerView
Wisej.NET 4.2.0+
The SchedulerView is a calendar of appointments: a toolbar to move between periods and switch layouts, and a grid of time slots in which appointments appear as coloured blocks. Users drag across empty slots to create an appointment, drag one to move it and drag its trailing edge to resize it; the server validates each change and can cancel it before it is committed.
Use it for anything booked by the hour or the day: service visits, meeting rooms, shifts, delivery slots, equipment hire. For tasks with dependencies laid out along weeks and months use a GanttView; to let the user pick a single date, the MonthCalendar is enough.
For a complete list of properties, methods, and events, see the API documentation.
Features
Views
View selects the layout, and the toolbar lets the user switch between them:
SchedulerViewMode | Layout |
|---|---|
Day | One day, in time slots. |
Week | Seven days side by side, in time slots. The default. |
WorkWeek | Monday to Friday, in time slots. |
Month | A month grid with the appointments of each day. |
Agenda | A chronological list of the appointments in the period. |
Timeline | One row per resource, with the hours running across. |
Date is the anchor date that decides which period is visible, and RangeStart and RangeEnd report the first visible day and the day after the last. Navigate(1) and Navigate(-1) move one period forward or back, and Today() returns to the current date — the same as the toolbar buttons. ViewChanged and RangeChanged tell you when the user has done either, which is the moment to load the appointments for the new range.
Time Slots
The time-slot layouts show the hours from StartHour (inclusive, default 8) to EndHour (exclusive, default 18), split into slots of SlotDuration minutes (default 30; it must divide 60). ShowCurrentTime draws a line at the current time.
Appointments
Appointments holds SchedulerAppointment objects. Each has a Start and an End — the end is exclusive — a Text, a Tone (a MeterTone) for its colour, and AllDay to place it in the all-day row. ResourceId assigns it to a resource, and Tag keeps any object of yours on the server; it is never sent to the browser. Each appointment also has an Id, generated for you unless you set one.
Dates are wall-clock values as your application sees them; the browser does not convert them to its own time zone. Changing a property of an appointment already in the collection updates the view.
Recurrence
Set Recurrence to a SchedulerRecurrence to repeat an appointment. Frequency is Daily, Weekly, Monthly or Yearly, Interval the number of those units between occurrences, and Count or Until bound the series. Occurrences are calculated only for the visible range. When the user moves or resizes one occurrence, that occurrence is detached and the rest of the series keeps the rule.
GetOccurrences() returns the visible occurrences in chronological order, each with its source Appointment and its own Start and End.
Resources
Resources holds SchedulerResource objects — people, rooms, vehicles — each with an Id, a Text and a Tone. The Timeline view draws one row per resource, plus a row for unassigned appointments, and dragging an appointment to another row changes its ResourceId.
Editing and Events
AllowCreate, AllowMove and AllowResize turn the three kinds of edit on and off. The appointment follows the pointer in the browser; the server is asked only when the user lets go.
| Event | Raised when | Event data |
|---|---|---|
AppointmentCreating | Before a range dragged across empty slots becomes an appointment. Set Cancel to reject it. | SchedulerAppointmentChangingEventArgs |
AppointmentMoving, AppointmentResizing | Before an occurrence is moved or resized. Set Cancel to reject it. | SchedulerAppointmentChangingEventArgs |
AppointmentMoved, AppointmentResized | After the change is committed. | SchedulerAppointmentEventArgs |
AppointmentClick, AppointmentDoubleClick | An appointment is clicked or double-clicked. | SchedulerAppointmentEventArgs |
SlotDoubleClick | An empty slot is double-clicked, or activated with Enter. | SchedulerSlotEventArgs: Start, End, ResourceId |
Both appointment event data classes carry the Appointment, the OccurrenceStart that identifies the occurrence of a recurring one, its Start and End, and its ResourceId. In the "changing" events those are the proposed values. In AppointmentCreating, Appointment is the new appointment, and its Text starts out as NewAppointmentText.
How To
Load a Week of Appointments
this.schedulerView1.View = SchedulerViewMode.WorkWeek;
this.schedulerView1.StartHour = 7;
this.schedulerView1.EndHour = 19;
foreach (var visit in db.ServiceVisits.Where(v => v.Start >= from && v.Start < to))
{
this.schedulerView1.Appointments.Add(new SchedulerAppointment
{
Id = visit.VisitNo,
Text = $"{visit.Customer} · {visit.Job}",
Start = visit.Start,
End = visit.End,
Tone = visit.Urgent ? MeterTone.Danger : MeterTone.Primary,
ResourceId = visit.TechnicianId,
Tag = visit
});
}
Plan by Technician
this.schedulerView1.Resources.Add(new SchedulerResource { Id = "T-07", Text = "Anna Weber", Tone = MeterTone.Success });
this.schedulerView1.Resources.Add(new SchedulerResource { Id = "T-12", Text = "Marco Rossi", Tone = MeterTone.Warning });
this.schedulerView1.View = SchedulerViewMode.Timeline;
// Every Monday at 8:00, for twelve weeks.
this.schedulerView1.Appointments.Add(new SchedulerAppointment
{
Text = "Team briefing",
Start = new DateTime(2026, 3, 2, 8, 0, 0),
End = new DateTime(2026, 3, 2, 8, 30, 0),
Tone = MeterTone.Neutral,
Recurrence = new SchedulerRecurrence { Frequency = SchedulerRecurrenceFrequency.Weekly, Count = 12 }
});
Validate New and Moved Appointments
private void schedulerView1_AppointmentCreating(object sender, SchedulerAppointmentChangingEventArgs e)
{
e.Appointment.Text = "New service visit";
e.Cancel = e.Start.DayOfWeek == DayOfWeek.Sunday;
}
private void schedulerView1_AppointmentMoving(object sender, SchedulerAppointmentChangingEventArgs e)
{
var technician = e.ResourceId;
e.Cancel = this.absences.Any(a => a.TechnicianId == technician && a.Day == e.Start.Date);
}
private void schedulerView1_AppointmentMoved(object sender, SchedulerAppointmentEventArgs e)
{
var visit = (ServiceVisit)e.Appointment.Tag;
visit.Start = e.Start;
visit.End = e.End;
visit.TechnicianId = e.ResourceId;
db.SaveChanges();
}
Advanced
JavaScript Widget
| Item | Description |
|---|---|
| Class name | "wisej.web.SchedulerView" |
| Theme appearance | "schedulerview", see Themes. The theme also defines the scheduler's colours, one per MeterTone. |