Your search did not match any results.
Scheduler

Recurring Appointments

Documentation

This example demonstrates how to define recurring appointments. You can specify the appointment repetition interval programmatically or in the UI. In the former case, the appointment object should contain the recurrenceRule field. In the latter case, toggle the Repeat switcher on the appointment details form to mark the appointment as recurring and specify the required fields.

@model DevExtreme.NETCore.Demos.ViewModels.RecurringAppointmentsViewModel @(Html.DevExtreme().Scheduler() .ID("scheduler") .TimeZone("America/Los_Angeles") .DataSource(Model.Appointments) .Views(new[] { SchedulerViewType.Day, SchedulerViewType.Week, SchedulerViewType.Month }) .CurrentView(SchedulerViewType.Month) .CurrentDate(new DateTime(2021, 3, 25)) .StartDayHour(9) .FirstDayOfWeek(FirstDayOfWeek.Monday) .Resources(res => { res.Add() .FieldExpr("RoomId") .ValueExpr("Id") .ColorExpr("Color") .Label("Room") .DataSource(Model.Resources); }) .Height(600) .TextExpr("Text") .StartDateExpr("StartDate") .EndDateExpr("EndDate") .RecurrenceRuleExpr("RecurrenceRule") .RecurrenceExceptionExpr("RecurrenceException") )
using DevExtreme.NETCore.Demos.Models.SampleData; using DevExtreme.NETCore.Demos.ViewModels; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; namespace DevExtreme.NETCore.Demos.Controllers { public class SchedulerController : Controller { public ActionResult RecurringAppointments() { return View(new RecurringAppointmentsViewModel { Appointments = SampleData.RecurringAppointments, Resources = SampleData.RecurringAppointmentsResources }); } } }
using System; namespace DevExtreme.NETCore.Demos.Models { public class RecurringAppointment : Appointment { public int RoomId { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; namespace DevExtreme.NETCore.Demos.Models.SampleData { public partial class SampleData { public static readonly IEnumerable<RecurringAppointment> RecurringAppointments = new[] { new RecurringAppointment { Text = "Watercolor Landscape", RoomId = 1, StartDate = "2021-03-01T17:30:00.000Z", EndDate = "2021-03-01T19:00:00.000Z", RecurrenceRule = "FREQ=WEEKLY;BYDAY=TU,FR;COUNT=10" }, new RecurringAppointment { Text = "Oil Painting for Beginners", RoomId = 2, StartDate = "2021-03-01T17:30:00.000Z", EndDate = "2021-03-01T19:00:00.000Z", RecurrenceRule = "FREQ=WEEKLY;BYDAY=MO,TH;COUNT=10" }, new RecurringAppointment { Text = "Testing", RoomId = 3, StartDate = "2021-03-01T20:00:00.000Z", EndDate = "2021-03-01T21:00:00.000Z", RecurrenceRule = "FREQ=WEEKLY;BYDAY=MO;WKST=TU;INTERVAL=2;COUNT=2" }, new RecurringAppointment { Text = "Meeting of Instructors", RoomId = 4, StartDate = "2021-03-01T17:00:00.000Z", EndDate = "2021-03-01T17:15:00.000Z", RecurrenceRule = "FREQ=DAILY;BYDAY=WE;UNTIL=20210401" }, new RecurringAppointment { Text = "Recruiting students", RoomId = 5, StartDate = "2021-02-24T18:00:00.000Z", EndDate = "2021-02-24T19:00:00.000Z", RecurrenceRule = "FREQ=YEARLY;BYWEEKNO=14", RecurrenceException = "20210411T180000Z" }, new RecurringAppointment { Text = "Final exams", RoomId = 3, StartDate = "2021-02-24T20:00:00.000Z", EndDate = "2021-02-24T21:35:00.000Z", RecurrenceRule = "FREQ=YEARLY;BYWEEKNO=15;BYDAY=TH,FR" }, new RecurringAppointment { Text = "Monthly Planning", RoomId = 4, StartDate = "2021-03-24T22:30:00.000Z", EndDate = "2021-03-24T23:45:00.000Z", RecurrenceRule = "FREQ=MONTHLY;BYMONTHDAY=28;COUNT=1" }, new RecurringAppointment { Text = "Open Day", RoomId = 5, StartDate = "2021-03-01T17:30:00.000Z", EndDate = "2021-03-01T21:00:00.000Z", RecurrenceRule = "FREQ=YEARLY;BYYEARDAY=87" } }; } }
namespace DevExtreme.NETCore.Demos.Models.SampleData { public class RecurringAppointmentsResource { public int Id { get; set; } public string Text { get; set; } public string Color { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; namespace DevExtreme.NETCore.Demos.Models.SampleData { public partial class SampleData { public static readonly IEnumerable<RecurringAppointmentsResource> RecurringAppointmentsResources = new[] { new RecurringAppointmentsResource { Id = 1, Text = "Room 101", Color = "#bbd806" }, new RecurringAppointmentsResource { Id = 2, Text = "Room 102", Color = "#f34c8a" }, new RecurringAppointmentsResource { Id = 3, Text = "Room 103", Color = "#ae7fcc" }, new RecurringAppointmentsResource { Id = 4, Text = "Meeting room", Color = "#ff8817" }, new RecurringAppointmentsResource { Id = 5, Text = "Conference hall", Color = "#03bb92" } }; } }