DwsCalendar
DwsCalendar is a scheduler for your own items: day, work-week, week, month, quarter and year views plus agenda and timeline variants, with inline create/edit/delete popups, drag-to-move, drag-to-resize, blocked and highlighted time, templates for every part and on-demand loading. Items are read and written by property name, so any class with a start and an end works as it is - no base type, no wrapper.
API ReferenceHighlighted time
HighlightedTimeRanges only tint time, each in its own Color, and allow everything. Hover a tinted slot for the range's name.
Show Code
Calendar.razor
<DwsCalendar Name="CalendarDemo_HighlightedCalendar" TItem="CalendarDemoEvent"
Data="@_events"
ColorSelector="@(item => item.Color)"
View="DwsCalendarViewType.Week"
HighlightedTimeRanges="@_highlightedRanges" />Calendar.razor.cs
// CalendarDemoEvent and CreateEvents(): see Basic data binding.
private readonly List<CalendarDemoEvent> _events = CreateEvents();
private readonly List<DwsCalendarTimeRange> _highlightedRanges = CreateHighlightedRanges();
private static List<DwsCalendarTimeRange> CreateHighlightedRanges()
{
DateTime today = DateTime.Today;
DateTime monday = StartOfWeek(today);
return
[
new DwsCalendarTimeRange(today.AddHours(8), today.AddHours(10), "Deep work") { Color = DwsColor.Success },
new DwsCalendarTimeRange(monday.AddDays(1).AddHours(16), monday.AddDays(1).AddHours(18), "Office hours") { Color = DwsColor.Info },
new DwsCalendarTimeRange(monday.AddDays(4).AddHours(13), monday.AddDays(4).AddHours(18), "Release freeze"),
];
}Appointment template
AppointmentTemplate replaces an appointment's content: an icon, the title and a category badge here. An appointment's accessible name - its title, day and time - takes the place of what AppointmentTemplate shows for a screen reader; OnAppointmentRender's AriaLabel names it otherwise. Every context carries the calendar as Owner, for its public API.
Show Code
Calendar.razor
<DwsCalendar Name="CalendarDemo_Templates" TItem="CalendarDemoEvent"
Data="@_events"
ColorSelector="@(item => item.Color)"
View="DwsCalendarViewType.Week"
Views="@(DwsCalendarViewType.Week | DwsCalendarViewType.Month)">
<AppointmentTemplate>
<span class="calendar-demo__template">
<i class="@GetCategoryIcon(context.Item.Category)" aria-hidden="true"></i>
<span class="calendar-demo__template-title">@context.Appointment.Title</span>
@if (!context.IsCompact)
{
<span class="calendar-demo__badge">@context.Item.Category</span>
}
</span>
</AppointmentTemplate>
</DwsCalendar>Calendar.razor.cs
// CalendarDemoEvent and CreateEvents(): see Basic data binding.
private readonly List<CalendarDemoEvent> _events = CreateEvents();
private static string GetCategoryIcon(string category) => category switch
{
"Team" => Icons.BS.People,
"People" => Icons.BS.ChatDots,
"Customer" => Icons.BS.Briefcase,
"Planning" => Icons.BS.Kanban,
// ...
_ => Icons.BS.CalendarEvent
};Calendar.razor <style>
/* The agenda and list rows lay the default content out in columns; span them all. */
.calendar-demo__template { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; min-width: 0; }
.calendar-demo__template-title { min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.calendar-demo__badge { padding: 0 0.375rem; border-radius: 999px; background-color: var(--dws-calendar-item-color, var(--primary)); color: var(--white); font-size: 0.7rem; line-height: 1.1rem; white-space: nowrap; }Day template
DayTemplate replaces the day labels: a counter marks days with three or more appointments. In the quarter and year views it is rendered inside a button, so keep it to text and icons.
Show Code
Calendar.razor
<DwsCalendar Name="CalendarDemo_DayTemplateCalendar" TItem="CalendarDemoEvent"
Data="@_events"
ColorSelector="@(item => item.Color)"
View="DwsCalendarViewType.Month"
Views="@(DwsCalendarViewType.Week | DwsCalendarViewType.Month)">
<DayTemplate>
<span class="calendar-demo__day @(context.IsToday ? "calendar-demo__day--today" : null)">
@(context.View == DwsCalendarViewType.Month ? context.Date.Day.ToString() : context.Date.ToString("ddd d"))
@if (context.Appointments.Count >= 3)
{
<span class="calendar-demo__busy" title="@($"{context.Appointments.Count} appointments")">@context.Appointments.Count</span>
}
</span>
</DayTemplate>
</DwsCalendar>Calendar.razor.cs
// CalendarDemoEvent and CreateEvents(): see Basic data binding.
private readonly List<CalendarDemoEvent> _events = CreateEvents();Calendar.razor <style>
.calendar-demo__day { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 600; }
.calendar-demo__day--today { color: var(--primary); }
.calendar-demo__busy { min-width: 1rem; padding: 0 0.25rem; border-radius: 999px; background-color: var(--warning); color: var(--status-text); font-size: 0.65rem; line-height: 1rem; text-align: center; }Cell template
CellTemplate adds content to every slot and day cell: a faint dot at each full working hour here; a month-view day would show it in its header, beside the date.
Show Code
Calendar.razor
<DwsCalendar Name="CalendarDemo_CellTemplateCalendar" TItem="CalendarDemoEvent"
Data="@_events"
ColorSelector="@(item => item.Color)"
View="DwsCalendarViewType.Week">
<CellTemplate>
@if (!context.AllDay && context.IsWorkingTime && context.Start.Minute == 0)
{
<span class="calendar-demo__cell-dot" aria-hidden="true"></span>
}
</CellTemplate>
</DwsCalendar>Calendar.razor.cs
// CalendarDemoEvent and CreateEvents(): see Basic data binding.
private readonly List<CalendarDemoEvent> _events = CreateEvents();Calendar.razor <style>
.calendar-demo__cell-dot { display: block; width: 4px; height: 4px; margin: 3px 4px 0 auto; border-radius: 50%; background-color: var(--dws-calendar-grid-line); }Tooltips
TooltipSelector builds each appointment's tooltip: here the title, the category and the description.
Show Code
Calendar.razor
<DwsCalendar Name="CalendarDemo_TooltipsCalendar" TItem="CalendarDemoEvent"
Data="@_events"
ColorSelector="@(item => item.Color)"
View="DwsCalendarViewType.Week"
TooltipSelector="GetOverflowTooltip" />Calendar.razor.cs
// CalendarDemoEvent and CreateEvents(): see Basic data binding.
private readonly List<CalendarDemoEvent> _events = CreateEvents();
private static string? GetOverflowTooltip(CalendarDemoEvent item) =>
string.IsNullOrWhiteSpace(item.Description)
? $"{item.Title} [{item.Category}]"
: $"{item.Title} [{item.Category}]\n{item.Description}";Time axis
SlotMinutes, SlotHeight, DayStartHour and DayEndHour shape the time axis - here 15-minute slots from 07:00 to 20:00 - and TimelineSlotWidth sizes the timeline's slots. In a grid this dense a 15-minute appointment would be 16 px tall: MinAppointmentHeight (24 px) and, on a touch device, TouchMinAppointmentHeight (36 px) keep it large enough to hit - it is drawn as if it lasted that long, and an appointment it would cover moves beside it; for a touch-first page a SlotHeight of 44 with 30-minute slots is the better lever. ScrollToHour picks where a time-axis view opens. The timeline's hours run left to right, also on a right-to-left page.
Show Code
Calendar.razor
<DwsCalendar Name="CalendarDemo_TimeAxis" TItem="CalendarDemoEvent"
Data="@_events"
ColorSelector="@(item => item.Color)"
View="DwsCalendarViewType.Week"
Views="@(DwsCalendarViewType.Day | DwsCalendarViewType.Week | DwsCalendarViewType.Timeline)"
SlotMinutes="15"
SlotHeight="16"
TimelineSlotWidth="32"
DayStartHour="7"
DayEndHour="20"
ScrollToHour="8" />Calendar.razor.cs
// CalendarDemoEvent and CreateEvents(): see Basic data binding.
private readonly List<CalendarDemoEvent> _events = CreateEvents();Working time
WorkDays (Monday to Thursday), WorkDayStartHour and WorkDayEndHour (09:00 to 16:00) define the working time: the work-week view shows the working days and HighlightWorkingHours shades everything else.
Show Code
Calendar.razor
<DwsSwitch Name="CalendarDemo_TimeAxis_WorkingHours" Label="HighlightWorkingHours" @bind-Value="@_highlightWorkingHours" />
<DwsCalendar Name="CalendarDemo_WorkingTimeCalendar" TItem="CalendarDemoEvent"
Data="@_events"
ColorSelector="@(item => item.Color)"
View="DwsCalendarViewType.WorkWeek"
Views="@(DwsCalendarViewType.WorkWeek | DwsCalendarViewType.Week)"
WorkDays="@_workDays"
WorkDayStartHour="9"
WorkDayEndHour="16"
HighlightWorkingHours="@_highlightWorkingHours" />Calendar.razor.cs
// CalendarDemoEvent and CreateEvents(): see Basic data binding.
private readonly List<CalendarDemoEvent> _events = CreateEvents();
private static readonly IReadOnlyCollection<DayOfWeek> _workDays = [DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday];
private bool _highlightWorkingHours = true;Without the all-day row
ShowAllDayRow=false hides the all-day row: a timed appointment lasting a day or longer - the 24-hour on-call shift from Tuesday evening - is then drawn on the time axis, one block per day, while all-day appointments such as the company offsite are not shown in these views (switch to Timeline to see them).
Show Code
Calendar.razor
<DwsCalendar Name="CalendarDemo_AllDayRowCalendar" TItem="CalendarDemoEvent"
Data="@_timeAxisEvents"
ColorSelector="@(item => item.Color)"
View="DwsCalendarViewType.Week"
Views="@(DwsCalendarViewType.Week | DwsCalendarViewType.Timeline)"
ShowAllDayRow="false" />Calendar.razor.cs
private readonly List<CalendarDemoEvent> _timeAxisEvents = CreateTimeAxisEvents();
// With the all-day row hidden, a timed appointment of a day or longer is drawn on the time axis, one block per day.
private static List<CalendarDemoEvent> CreateTimeAxisEvents()
{
List<CalendarDemoEvent> events = CreateEvents(); // see Basic data binding
DateTime tuesday = StartOfWeek(DateTime.Today).AddDays(1);
events.Add(Timed("On call", tuesday.AddHours(17), 24 * 60, DwsColor.Warning, "Operations", "24 hours on call, from Tuesday to Wednesday evening."));
return events;
}Per-appointment styling
OnAppointmentRender adds classes, styles, a tooltip or an accessible name (AriaLabel) per appointment - cancelled items get a class this page strikes through, and a name that says so to a screen reader, which does not see the strike-through.
Show Code
Calendar.razor
<style>
.calendar-demo__cancelled { --dws-calendar-item-color: var(--secondary); }
.calendar-demo__cancelled .dws-calendar__appointment-title { text-decoration: line-through; }
</style>
<DwsCalendar Name="CalendarDemo_AppointmentRenderCalendar" TItem="CalendarDemoEvent"
Data="@_events"
ColorSelector="@(item => item.Color)"
View="DwsCalendarViewType.Week"
OnAppointmentRender="MarkCancelled" />Calendar.razor.cs
// CalendarDemoEvent and CreateEvents(): see Basic data binding.
private readonly List<CalendarDemoEvent> _events = CreateEvents();
// Runs synchronously for every appointment element on every render - keep it cheap.
private static void MarkCancelled(DwsCalendarAppointmentRenderArgs<CalendarDemoEvent> args)
{
if (args.Item.Cancelled)
{
args.CssClass = "calendar-demo__cancelled";
args.Tooltip = $"{args.Item.Title} (cancelled)";
// The accessible name - by default title, day and time - is what a screen reader hears instead of the
// struck-through text, so it says so.
args.AriaLabel = $"{args.Item.Title}, cancelled, {args.Appointment.Start:f} – {args.Appointment.End:t}";
}
}Disabled
Disabled has the same effect as ReadOnly and dims the calendar.
Show Code
Calendar.razor
<DwsCalendar Name="CalendarDemo_Disabled" TItem="CalendarDemoEvent"
AdditionalAttributes="@_disabledAttributes"
Data="@_events"
ColorSelector="@(item => item.Color)"
View="DwsCalendarViewType.Month"
Views="@(DwsCalendarViewType.Week | DwsCalendarViewType.Month)"
Disabled="true"
EnableAppointmentCreation="true"
EnableAppointmentEditing="true"
EnableAppointmentDeletion="true"
EnableDragging="true"
EnableResizing="true" />Calendar.razor.cs
// CalendarDemoEvent and CreateEvents(): see Basic data binding.
private readonly List<CalendarDemoEvent> _events = CreateEvents();
private readonly Dictionary<string, object> _disabledAttributes = new() { ["aria-label"] = "Disabled calendar" };Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| DisplayedView | DwsCalendarViewType | DwsCalendarViewType.Month | The view on screen. Differs from View when the view was switched without @bind-View. |
| DisplayedDate | DateTime | today | The date the view is built around. Differs from CurrentDate when it was navigated without @bind-CurrentDate. |
| VisibleRange | DwsCalendarDateRange | The days on screen, from Start up to, but not including, End. | |
| HeaderTitle | string | The toolbar title for the view on screen, e.g. "September 2026". | |
| Appointments | IReadOnlyList<DwsCalendarAppointment<TItem>> | [] | Every appointment the calendar knows, in source order. |
| ActiveGroups | IReadOnlyList<DwsCalendarGroup> | [] | The groups the calendar lays out by: Groups without null entries, keyless groups and repeated keys. |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| PreviousAsync | Task | Shows the previous day, week, month, quarter, year or agenda period. | |
| NextAsync | Task | Shows the next day, week, month, quarter, year or agenda period. | |
| TodayAsync | Task | Shows the period containing today - by the calendar's clock (see ShowCurrentTimeIndicator). | |
| NavigateAsync | Task | int step | Moves step periods back (negative) or forward (positive). |
| GoToDateAsync | Task | DateTime date | Shows the period containing date. |
| SetViewAsync | Task | DwsCalendarViewType view | Switches to view. Ignored when it is not one of Views. |
| RefreshAsync | Task | Re-reads the data and re-renders: runs DataLoader again for the days on screen, or re-reads Data - for items that were changed in place, where Data itself did not change. The items read are matched with the ones shown before by reference, or by ItemKeySelector when it is set: a popup showing an item that is gone closes (OnPopupClose), a drag of it ends, and a selection of it is cleared (SelectedItemChanged and OnAppointmentSelect). An open editor of an item still there keeps what the user changed; the values the user did not touch follow what was read. | |
| FindAppointment | DwsCalendarAppointment<TItem>? | TItem item | The appointment shown for item, or null when the calendar does not show it. |
| GetAppointments | IReadOnlyList<DwsCalendarAppointment<TItem>> | DateTime from, DateTime to | The appointments overlapping [from, to), in display order. |
| SelectAsync | Task | TItem? item | Selects item, or clears the selection for null. |
| OpenDetailsPopupAsync | Task | TItem item | Opens the details popup for item, centered in the viewport. |
| OpenEditPopupAsync | Task | TItem item | Opens the edit popup for item, when editing it is allowed. |
| OpenCreatePopupAsync | Task | DateTime start, DateTime end, bool allDay, object? group | Opens the create popup for a new appointment from start to the exclusive end, when creating is allowed and the time is not blocked. With a DateOnly StartField the appointment is always all-day. |
| ClosePopupAsync | Task | Closes the open popup, discarding any unsaved edit. It is meant for code outside the calendar, so focus stays where it is - only popups the user closes hand focus back, to the appointment the popup was opened from or to the calendar. A close button inside a template uses the context's CloseAsync (AppointmentDetailsTemplate) or CancelAsync (AppointmentEditTemplate) instead, which hand focus back too: the focused button goes with the popup. Unlike the popup's own Close and Cancel buttons, Escape and the backdrop, which are ignored while a save or delete awaits its handler, it also closes such a popup; the save or delete still completes. | |
| MoveAppointmentAsync | Task<bool> | TItem item, DateTime start, DateTime? end | Moves item to start, keeping its duration unless end is given. Goes through OnAppointmentMove like a drag does, and refuses the times a drag refuses. It runs regardless of ReadOnly, Disabled (also by a permission), register mode, EnableDragging, EnableRescheduling and CanDrag - they gate the calendar's own UI, so check them yourself before calling it from a template's button. An item without an end of its own (none, or DateTime.MaxValue) keeps it when its duration is kept, however far on it moves: only its start is written, and the handler sees the end the calendar shows it with, at most a week before DateTime.MaxValue. Returns true when the item was changed - false when the calendar does not show the item or cannot write its times, when the new time is blocked (BlockedTimeRanges, IsTimeBlocked), when end lies before start (or on it, for an appointment that has a length) or would lie past DateTime.MaxValue, when the handler cancels or puts NewEnd before NewStart, or while another change of the item still awaits its handler. |
| DeleteAppointmentAsync | Task<bool> | TItem item | Deletes item through OnAppointmentDeleting, without asking for confirmation, and closes a popup showing it (raising OnPopupClose). It runs regardless of ReadOnly, Disabled (also by a permission), register mode, EnableAppointmentDeletion and CanDelete - they gate the calendar's own UI, so check them yourself before calling it from a template's button. Returns true when the item was removed - false when the calendar does not show the item, when the handler cancels, or while another change of the item still awaits its handler. |
| ScrollToHourAsync | Task | int hour | Scrolls the day, week or timeline view to hour. Does nothing in the other views. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Data | IEnumerable<TItem>? | null | The items to show. Supports two-way binding via @bind-Data: creating or deleting an appointment raises DataChanged. When this is a mutable collection (a List<T>, say) new items are added to it and deleted ones removed from it in place; otherwise the calendar keeps its own copy until a different collection or a new DataVersion arrives - passing the same collection again, or the one DataChanged handed out, keeps the created and deleted appointments. A delete removes every reference to the item from it, should it be in there twice. Ignored while DataLoader is set. A sequence that throws while it is enumerated is logged and shown as empty, and read again on the next parameter set. Null entries are skipped and an item listed twice is shown once. Items are followed by reference: a new instance of an item shown before is a new appointment - a popup showing the old one closes, a drag of it ends and a selection of it is cleared - unless ItemKeySelector matches them up. |
| DataVersion | int | 0 | Bump this to make the calendar re-read Data after its items were changed in place rather than replaced. |
| DataLoader | Func<DwsCalendarDateRange, CancellationToken, Task<IEnumerable<TItem>>>? | null | Loads the items for the days on screen, each time that range changes (and on RefreshAsync). A load still running when the range changes again is cancelled through the token; whatever a cancelled load then throws is ignored. A load that fails is logged and leaves the calendar in the Error state (GetComponentState). While it is set, Data is ignored. Handing in a different delegate alone does not reload - call RefreshAsync for that. Removing it cancels a load still running, and the calendar shows Data again. A loader usually returns new instances on every call (deserialised JSON, an untracked query): without ItemKeySelector each load then closes a popup showing one of them, with its unsaved input, and clears a selection of one. |
| ItemKeySelector | Func<TItem, object>? | null | A stable key for an item, e.g. item => item.Id. Optional: without it items are followed by reference. With it, a new instance whose key matches an item shown before - from a DataLoader or RefreshAsync that returns fresh copies, or new Data - takes over that item's appointment: an open popup stays, a drag and a day's "+ more" list go on, the selection moves to the new instance (reported through SelectedItemChanged, not OnAppointmentSelect), and a change still awaiting its handler is written to the new instance. A reload may bring values another user saved meanwhile: an open editor keeps what the user changed, and the values the user did not touch follow the new instance - the title and the description each, the times (start, end and all-day) together - so saving writes only the user's changes; a change awaiting its handler likewise writes only the values it changes (a move keeps a title the reload renamed). Keys are compared with Equals; an item whose key is null is followed by reference. |
| StartField | string | "Start" | The item property holding the start: DateTime, DateTimeOffset or DateOnly, each optionally nullable. Items without a start are not shown. A DateTime is written back with the DateTimeKind it had, a DateTimeOffset with its own offset (when it was unset, the offset of the local zone - the zone of the calendar's clock at the time of writing, see ShowCurrentTimeIndicator). A DateOnly start makes every item all-day: new appointments are created all-day, a drag onto the time axis is refused and the editor's all-day checkbox is locked. Creating, dragging and resizing need it and EndField to be writable properties declared on TItem itself (not only on a derived type); otherwise they stay off, and that is logged once. |
| EndField | string | "End" | The item property holding the exclusive end. An item without one is shown as starting and ending at its start. Creating, dragging and resizing need it to be writable, as StartField does. |
| TitleField | string | "Title" | The item property holding the title. |
| DescriptionField | string | "Description" | The item property holding the description. Optional: the item type does not need to have it. |
| AllDayField | string | "AllDay" | The bool item property marking an all-day appointment. Optional: the item type does not need to have it. |
| GroupField | string | "Group" | The item property holding the key of the group an appointment belongs to (see Groups). Optional: the item type does not need to have it. Moving an appointment to another group - dropping it in that group's column or row, picking the group in the edit popup - needs it to be writable; a key of another type is converted to the property's type (an int key for a long property, an enum's number), and one that cannot be is logged once. |
| AllDayEndInclusive | bool | false | Whether an all-day item stores its last day as its end (26-28 September ends on the 28th) instead of the day after it (ends on the 29th, the default). The calendar reads and writes the item's all-day ends in this convention; DwsCalendarAppointment.End and the ends in the event arguments stay exclusive either way. |
| ItemFactory | Func<TItem>? | null | Creates the item for a new appointment. Without it the item type's public parameterless constructor is used. It must return a new instance every time: a null result, or an item that is already in the data, creates nothing - the popup shows that saving failed, and the cause is logged. |
| ColorSelector | Func<TItem, DwsColor>? | null | The theme color of an item. Falls back to AppointmentColor, also for an item it throws for; that is logged once, and the item is asked again on the next parameter set. A different delegate - a method group or a lambda in markup is a new one on every render of the page - asks every item again, so a selector that reads the page's state follows it; the items themselves are not read again for that. |
| AppointmentClassSelector | Func<TItem, string?>? | null | Additional CSS classes for an item's appointment element. |
| TooltipSelector | Func<TItem, string?>? | null | An item's tooltip. Defaults to its title and time. |
| CanEdit | Func<TItem, bool>? | null | Whether a given item may be edited, when EnableAppointmentEditing is on. |
| CanDelete | Func<TItem, bool>? | null | Whether a given item may be deleted, when EnableAppointmentDeletion is on. |
| CanDrag | Func<TItem, bool>? | null | Whether a given item may be dragged, when EnableDragging is on. |
| CanResize | Func<TItem, bool>? | null | Whether a given item may be resized, when EnableResizing is on. |
| SelectedItem | TItem? | null | The selected item. Supports two-way binding via @bind-SelectedItem; clicking an appointment selects it, clicking an empty slot clears it. It is also cleared - through SelectedItemChanged and OnAppointmentSelect - when the data no longer holds it: new Data, a DataVersion bump or RefreshAsync without it, or a DataLoader result without it (also the one for another range). An item passed before the data that holds it arrived stays selected. Its appointment is highlighted and carries aria-current="true" for assistive technology. |
| View | DwsCalendarViewType | DwsCalendarViewType.Month | The view on screen. Supports two-way binding via @bind-View. A view that is not in Views falls back to the first one that is, and ViewChanged reports the correction. |
| Views | DwsCalendarViewType | DwsCalendarViewType.Standard | The views the user may switch between, as flags. Standard is Day, WorkWeek, Week, Month, Quarter and Year; the Agenda and Timeline variants are off by default - add them with DwsCalendarViewType.Standard | DwsCalendarViewType.Agenda, for example, or use All. The timeline's time axis runs left to right, also on a right-to-left page (dir="rtl"), and the text of its bars keeps its own direction; the calendar has no right-to-left layout beyond that. |
| CurrentDate | DateTime | default (today) | The date the view is built around. Supports two-way binding via @bind-CurrentDate. Only the date part is used and compared, so passing DateTime.Now does not undo the user's navigation. Unset (default) it is today, and a date outside 0002-01-01 to 9998-12-31 is clamped to that range; CurrentDateChanged reports either correction. |
| FirstDayOfWeek | DayOfWeek? | null | The first day of the week. Defaults to the current culture's (Sunday for en-US, Monday for de-DE). |
| WorkDays | IReadOnlyCollection<DayOfWeek>? | null | The working days, shown by the work-week view and highlighted as working time. Defaults to Monday to Friday. |
| AgendaDays | int | 7 | How many days the agenda view lists, starting at CurrentDate: 1 to 366, a value outside that is held at the nearer limit. Close to the last supported date the list ends with the days that are left. |
| DrillDownOnDateClick | bool | true | Whether clicking a date label opens that date in the day view (when the day view is enabled). Without it - and without an OnDateClick handler - clicking a date does nothing, so the date labels and quarter/year days are plain text rather than buttons. |
| ShowHeader | bool | true | Whether the toolbar (or HeaderTemplate) is shown. |
| ShowNavigation | bool | true | Whether the toolbar shows the previous/next buttons. |
| ShowTodayButton | bool | true | Whether the toolbar shows the today button. |
| ShowDateSelector | bool | true | Whether the toolbar shows a date input to jump to any date. The input has no permission name of its own - this is how a page hides it - and is read-only while the page is in permission-selection (register) mode, where a click on it selects the calendar. |
| ShowViewSwitcher | bool | true | Whether the toolbar shows the view switcher. It is hidden anyway while only one view is enabled. |
| ShowNewAppointmentButton | bool | true | Whether the toolbar shows a "New appointment" button while appointments can be created (EnableAppointmentCreation on, neither ReadOnly nor Disabled). It opens the create popup, lasting DefaultAppointmentDuration, on today when today is on screen and otherwise on the displayed date (or the first day a work week shows), at the first free slot from WorkDayStartHour within the hours the view shows - the keyboard route to creating an appointment. The button registers for permissions as <Name>_NewAppointment and stays on screen in permission-selection (register) mode, where a click selects it instead of opening the popup. Arming the page neither adds nor removes it: a calendar that is disabled when the page is armed - by Disabled or by a permission - shows none there either, although arming lifts its Disabled so the calendar itself can be selected. |
| AlwaysShowYear | bool | false | Whether the title always includes the year. By default the year is left out while the view lies in the current year. A range across the turn of a year names the year at both ends either way ("Dec 28, 2026 – Jan 3, 2027"), and a range of a single day - an agenda of one day, a work week of one working day - is titled as the day view is. |
| HeaderTemplate | RenderFragment<DwsCalendarHeaderContext<TItem>>? | null | Replaces the whole toolbar. The context brings the title, the view on screen, the current date, the visible range, the enabled views and the calendar as Owner, whose PreviousAsync, NextAsync, TodayAsync, GoToDateAsync and SetViewAsync drive it. |
| ToolbarContent | RenderFragment? | null | Extra content at the end of the built-in toolbar, before the New appointment button and the view switcher. |
| TimeZone | TimeZoneInfo? | null | The time zone the calendar's 'now' is taken in - today's marker, the current-time line, what Today shows and an unset CurrentDate - and whose offset a new or unset DateTimeOffset field gets. null: the zone of the app's clock (a registered TimeProvider, else the machine). The appointments' own times are not converted: the calendar shows the clock times its items hold. DwsScheduler converts items that carry a time zone (TimeZoneField, DisplayTimeZone) and sets this to its display zone. |
| AllowExternalDrop | bool | false | Whether something dragged in from outside the calendar - a draggable element of the page, a file, text from another program - can be dropped on a time slot or a day cell; OnExternalDrop then says where. Blocked time takes no drop, nor does a read-only or disabled calendar. The slot under the pointer is marked by a script on the calendar, without a round trip. A mouse gesture with no touch or keyboard equivalent: offer the same action another way too (a button that calls OpenCreatePopupAsync). |
| SlotMinutes | int | 30 | The length of one time slot, in minutes. Snaps to a divisor of 60 (5, 10, 15, 20, 30 or 60). |
| SlotHeight | int | 24 | The height of one time slot in the day and week views, in pixels (at least 8). For a touch-first layout 44 (with SlotMinutes 30) gives every half-hour appointment a comfortable target. |
| MinAppointmentHeight | int | 24 | The smallest height an appointment is drawn with in the day and week views, in pixels. A shorter appointment is laid out as if it lasted long enough to reach it: the time grid keeps its scale, and an appointment it would cover moves beside it, as overlapping ones do. Never less than one time slot. |
| TouchMinAppointmentHeight | int | 36 | MinAppointmentHeight on a device whose main pointer is a finger (pointer: coarse), in pixels; the larger of the two applies there. 0 uses MinAppointmentHeight everywhere (the calendar then does not ask for the pointer type). |
| TimelineSlotWidth | int | 48 | The width of one time slot in the timeline view, in pixels (at least 16). |
| DayStartHour | int | 0 | The first hour shown on the time axis (0-23). |
| DayEndHour | int | 24 | The hour the time axis ends at (1-24). |
| WorkDayStartHour | int | 8 | The hour working time starts on a working day. |
| WorkDayEndHour | int | 17 | The hour working time ends on a working day. |
| ScrollToHour | int? | null | The hour the time axis is scrolled to when a time-axis view opens. Defaults to WorkDayStartHour. |
| HighlightWorkingHours | bool | true | Whether time outside the working hours and working days is shaded. |
| ShowAllDayRow | bool | true | Whether the day and week views show the all-day row above the time axis. Without it, timed appointments lasting a day or longer are drawn on the time axis instead, one block per day that continues into the next, and all-day appointments are not shown in those views at all - the month, agenda and timeline views still show them. |
| ShowCurrentTimeIndicator | bool | true | Whether a line marks the current time. It moves every minute; the calendar re-renders for it only while the line is on screen - a day, week or timeline view showing today within DayStartHour to DayEndHour - and when the date changes. Now and today - this line, the today markers, the Today and New appointment buttons, an unset CurrentDate and the title's current year - come from a TimeProvider registered in the app's services (services.AddSingleton<TimeProvider>(...)), and from the system clock without one; a registered one pins the calendar's time, for a demo on a fixed date or a test. Its LocalTimeZone also gives a new or unset DateTimeOffset field its offset, read at each write - so a clock that learns the browser's zone only after the first render is followed. |
| DefaultAppointmentDuration | TimeSpan | TimeSpan.FromHours(1) | How long a new timed appointment lasts when nothing else gives it a length: double-clicking a single time slot (or a day, for an item type without an all-day flag), the toolbar's New appointment button, switching All day off in the editor, or dropping an all-day appointment on the time axis. A value that is not longer than zero, or longer than 366 days, is not used: a time slot then gives its own length, everything else one hour. Where it would run a double-clicked slot's appointment into blocked time, that one ends where the blocked time begins; a double-clicked day, like the New appointment button, starts at the first slot from WorkDayStartHour that is free for the whole duration. |
| MaxVisibleAppointmentsPerDay | int | 3 | How many appointments a day shows before the rest collapse into a "+ more" link (month view and all-day row), and how many markers a quarter-view day shows (a year-view day shows up to three). Zero shows them all: the month rows grow to fit their busiest day and a quarter-view day shows every marker. Up to 10, every month row is as tall as the limit needs, so the rows stay even; a larger limit reserves nothing, and the rows grow to fit as with zero. |
| WrapAppointmentText | bool | false | Whether appointment text wraps where an appointment grows with it: the blocks of the day, work week and week views, and the rows of the agenda and the "+ more" list. By default it is cut off with an ellipsis and the full text is in the tooltip. The one-line bars - all-day and multi-day bars, month-view entries and timeline bars - always keep the ellipsis and the tooltip, as wrapped text would be cut off in them. The time of an agenda or "+ more" list row wraps in its column either way, as a range across days does not fit it on one line. |
| BlockedTimeRanges | IEnumerable<DwsCalendarTimeRange>? | null | Time ranges in which no appointment can be created, or moved or resized into. A timed appointment is blocked by any overlap - a zero-length one by blocked time at its start; an all-day appointment only by a day that is blocked from start to end, by one range or by several ranges and IsTimeBlocked between them. Each range is hatched on the time axis with its Title as a label ("Blocked" without one), and the time slots it covers carry the title as their tooltip; the month, quarter, year and agenda views hatch the days blocked from start to end and name the ranges in their tooltip. A range whose End is not after its Start is empty and ignored. |
| IsTimeBlocked | Func<DateTime, bool>? | null | Blocks recurring time by rule - evaluated for the start of every time slot, e.g. t => t.Hour == 12 for a daily lunch break. Combined with BlockedTimeRanges. The slots it blocks are hatched and carry a "Blocked" tooltip. |
| HighlightedTimeRanges | IEnumerable<DwsCalendarTimeRange>? | null | Time ranges that are tinted - in each range's Color, the warning color by default - without restricting anything: on the time axis with the range's Title as a label and as the tooltip of the slots it covers, in the month, quarter, year and agenda views as a tinted day named in its tooltip. A range whose End is not after its Start is empty and ignored. |
| Groups | IReadOnlyList<DwsCalendarGroup>? | null | The groups the day, work-week, week and timeline views lay appointments out by - rooms, people, machines (DwsScheduler's resources). Each group gets its own day columns side by side under its name (all of one group's days, then the next group's), and on the timeline its own rows; an appointment goes where its GroupField holds the group's Key (compared with Equals). Dragged into another group's column or row it moves to that group - OnAppointmentMove reports OldGroup and NewGroup - and the edit popup offers a group picker; a resize stays within its group, and Alt+Arrow keys move within it. The month, quarter, year and agenda views show every group's appointments together, and the details popup and the accessible names name the group. An appointment whose key matches no group is not shown in the grouped views. A new appointment goes into the group it was created in, and into the first group where none was (the toolbar, a month day). Null entries, keyless groups and repeated keys are skipped; a new list with the same keys lays nothing out again. |
| GroupTemplate | RenderFragment<DwsCalendarGroup>? | null | Replaces a group's name in its header - over its day columns, or beside its timeline rows. Keep it to text, icons and images: the header is no button. |
| ReadOnly | bool | false | Shows everything but allows no changes through the calendar's UI. Disabled (by parameter or permission) has the same effect and is dimmed. Setting it (or Disabled) while an edit, a create or a delete confirmation is open closes that popup (raising OnPopupClose) and ends a drag - except a popup whose save or delete already awaits its handler (a page that sets ReadOnly while its own handler runs): it closes when the change succeeds, and after a veto shows the message until a later parameter set still finds the calendar locked; a save, a confirmed delete and a drop are checked against the permissions again when they happen, so a lock that comes from a permission or CanEdit/CanDelete/CanDrag/CanResize changing its answer is honoured too - a refused save shows a message in the form. The consumer's own calls to MoveAppointmentAsync and DeleteAppointmentAsync still work. |
| EnableAppointmentCreation | bool | false | Whether appointments can be created: by double-clicking an empty slot or day, by dragging across empty slots, or with the toolbar's New appointment button (ShowNewAppointmentButton). A drag across blocked time is shown in red and creates nothing. Needs StartField and EndField to be writable properties declared on TItem; without them it stays off, and that is logged. |
| EnableAppointmentEditing | bool | false | Whether appointments can be edited in the popup (double-click, the details popup's edit button, or F2). |
| EnableAppointmentDeletion | bool | false | Whether appointments can be deleted (the popup's delete button, or the Delete key). |
| EnableDragging | bool | false | Whether appointments can be dragged to another time or day - or moved with the keyboard: Alt+Arrow moves a focused appointment by one step along the view's axes, as a drag there would. In the day, work-week and week views Alt+ArrowUp/ArrowDown move a timed appointment by one time slot and Alt+ArrowLeft/ArrowRight by one day (a bar in the all-day row only by days); in the month view left/right move by one day and up/down by one week; on the timeline left/right move a timed appointment by one time slot (an all-day one by one day) and up/down to the row of the day before or after. A keyboard move goes through OnAppointmentMove as a drop does and is refused where a drop is (blocked time, CanDrag, outside the supported dates) and where it would leave the hours the view shows - in the day, week and timeline views a timed appointment must keep overlapping DayStartHour to DayEndHour on a day it touches, or it would vanish from them; focus stays on the moved appointment, which is scrolled into view when the move took it past the edge of the scrolling time grid or timeline - or goes to the calendar when it left the days on screen - and a visually hidden live region reads out its new time. Movable appointments declare the keys in aria-keyshortcuts. The agenda view moves nothing, by key or by drag; a day's "+ more" list moves its entries by drag only - while one is dragged the list steps aside, so the days under it can be reached, and it closes when the drag ends. A bar across days keeps the day it was grabbed on under the pointer. Needs writable times, as EnableAppointmentCreation does; without them it stays off, and that is logged. |
| EnableResizing | bool | false | Whether appointments can be resized by dragging their end - or with the keyboard: Alt+Shift+Arrow moves a focused appointment's end by one step, along the same axes as EnableDragging's Alt+Arrow moves its start, through OnAppointmentResize. The handle sits at the bottom of a timed block, and at the right end of a bar - an all-day appointment, or a timed one across days, in the all-day row, the month view and the timeline - on the piece where the appointment ends. A timed bar dragged over day cells keeps the time of day it ends at, on the day it is released over; an all-day one ends with the day it is released over, on the timeline too. Released in the time slot that already holds the end, the end stays where it is. An appointment never gets shorter than one time slot (one day when it is all-day), and blocked time refuses the change, as does a new end that would take the appointment out of the hours the view shows (as for a keyboard move, see EnableDragging). Needs writable times, as EnableAppointmentCreation does; without them it stays off, and that is logged. |
| EnableRescheduling | bool | true | Whether an existing appointment's time may change at all. Off, dragging and resizing are disabled and the edit popup keeps the time fields read-only, while titles and descriptions stay editable. An AppointmentEditTemplate is held to it too: times it changes are not saved (context.CanEditTimes tells it to show them read-only). |
| ShowAppointmentDetails | bool | true | Whether clicking an appointment opens its details popup. While it does, the appointments carry aria-haspopup="dialog". |
| ConfirmDelete | bool | true | Whether deleting asks for confirmation first. Cancelling the confirmation - or a delete that OnAppointmentDeleting refuses - returns to the popup it was asked from; from the edit form, with its unsaved changes. One asked with the Delete key closes again, as no popup was open, and focus goes back to the appointment. |
| Haptic | DwsHapticFeedback | Success | Touch feedback (when haptics are switched on) when the built-in popup saved or deleted an appointment; a refused save or delete plays Error. Asked for when the outcome is known: Android plays it, iOS only shortly after the tap. None switches both off. |
| ShowTooltips | bool | true | Whether appointments show a tooltip. |
| AppointmentTemplate | RenderFragment<DwsCalendarAppointmentContext<TItem>>? | null | Replaces an appointment's content (the colored frame and its interactions stay the calendar's). The context brings the appointment, the item, the view, IsCompact (a one-line bar rather than a block) and the formatted TimeText. Browsers drag images and links on their own: in a draggable appointment the stylesheet lets the pointer pass through images, and keeps links from being dragged in Chromium- and WebKit-based browsers - Firefox ignores that rule, so give a link in the template draggable="false", or grabbing the appointment by it drags the link instead. |
| AppointmentDetailsTemplate | RenderFragment<DwsCalendarAppointmentContext<TItem>>? | null | Replaces the content of the details popup. The edit and delete buttons stay. A close button of the template's own calls context.CloseAsync(), which - like the popup's Close button - hands focus back to the appointment the popup was opened from, or to the calendar; it does nothing from an AppointmentTemplate, and while a delete awaits its handler. |
| AppointmentEditTemplate | RenderFragment<DwsCalendarEditContext<TItem>>? | null | Replaces the form of the create/edit popup. Bind inputs to context.Model and finish with context.SaveAsync() or context.CancelAsync(), which hand focus back as the built-in form's buttons do; the calendar validates and writes the item as it does for its own form - times that may not change are not saved, whatever the model holds. context.CanEditTimes (false while EnableRescheduling is off for an existing appointment, or the item's times cannot be written) says to show the time inputs read-only, context.CanDelete whether the appointment may be deleted, and context.IsBusy - read live - whether a save or delete awaits its handler, for a spinner; CancelAsync and DeleteAsync are ignored meanwhile. context.DeleteAsync() deletes as the built-in delete button does: after the confirmation while ConfirmDelete is on, cancelling which returns to the template with its unsaved changes. context.Error holds the message of the last refused save (show it, e.g. with role="alert") and context.IsNew tells a create from an edit. While context.Model.AllDay is set, Model.End is the last day (inclusive), as a date input shows it; switch it with context.SetAllDayAsync(bool), which converts the times as the built-in "All day" checkbox does - setting Model.AllDay alone converts nothing. SetAllDayAsync does nothing where that checkbox is disabled: while CanEditTimes is false, for an item type without a writable all-day property or with a DateOnly start, and while IsBusy. |
| CellTemplate | RenderFragment<DwsCalendarCellContext<TItem>>? | null | Content rendered inside every time slot and day cell. The context tells whether the cell is a whole day, blocked or working time. In a time slot (day, week and timeline views) it sits behind the appointments; in a month-view day it goes into the day's header, left of the date, as one line cut off with an ellipsis and cut off at the header's height where it is taller (two blocks, a line break), where the appointment bars never cover it; in the all-day row it fills the day behind the bars. The quarter, year and agenda views do not render it. |
| DayTemplate | RenderFragment<DwsCalendarDayContext<TItem>>? | null | Replaces a day's label: column header, month-view date number, quarter/year-view day, agenda date or timeline row label. The context brings the day's appointments. In the quarter and year views the whole day is one button - plain text while clicking a date does nothing - and the template is rendered inside it, so keep it to text and icons (phrasing content) - a link or button in it would be interactive content nested in a button. In the other views it takes the place of the clickable date link, and with it of the drill-down and OnDateClick. The built-in labels mark today with aria-current="date"; a template in those views marks its own (context.IsToday). |
| OverflowTemplate | RenderFragment<DwsCalendarOverflowContext<TItem>>? | null | Replaces the text of a day's "+ more" link. It is rendered inside the link's button, so keep it to text and icons (phrasing content). The button adds the day's full date after it as visually hidden text, so the link's accessible name keeps the template's text and says which day it belongs to. |
| Color | DwsColor | DwsColor.Primary | The accent color: today, the current-time line, the selection and the toolbar's Today, New appointment and view buttons. |
| AppointmentColor | DwsColor | DwsColor.Primary | The color of appointments that ColorSelector does not color. |
| Width | int? | null | A fixed width, in pixels. Without it the calendar fills its container. The body is the query container of the narrow layouts, so the views' content does not count toward the calendar's width: in a box sized to its content (a flex item that does not grow, an inline-block or fit-content wrapper, an absolutely positioned popover) the calendar is only 20rem wide, or as wide as its toolbar - give it a Width or MinWidth there, or let the box grow. |
| MinWidth | int? | null | The minimum width, in pixels. It also sizes a calendar in a box sized to its content, which is otherwise only 20rem wide, or as wide as its toolbar (see Width). |
| MaxWidth | int? | null | The maximum width, in pixels. |
| Height | int? | null | A fixed height, in pixels. The time-axis views scroll inside it; without it they scroll inside a default maximum height. |
| MinHeight | int? | null | The minimum height, in pixels - a floor, not a fixed height. Without Height and MaxHeight, the scrolling grid of the day, work week, week and timeline views grows as tall as it (or as its default height, if that is taller) before it scrolls, so it leaves no empty band in the calendar - the toolbar comes on top; the month view's rows stretch to fill it. |
| MaxHeight | int? | null | The maximum height, in pixels. Like Height, it makes the views scroll inside the calendar. |
| DateQueryParameter | string? | null | Link mode for the date: the query parameter (?date=2026-11-25) naming the initial date. Under static SSR the previous / next / today buttons are links that set it; without it they are not rendered there. |
| ViewQueryParameter | string? | null | Link mode for the view: the query parameter (?view=Week) naming the initial view. Under static SSR the view switcher is links that set it; without it the switcher is not rendered there. |
| Name | Typ | Description |
|---|---|---|
| DataChanged | EventCallback<IEnumerable<TItem>> | Raised after an appointment is created, changed or deleted, with the calendar's current items - the same collection instance as Data when that is mutable. Used by @bind-Data. |
| SelectedItemChanged | EventCallback<TItem?> | Raised when the selected item changes - also with null when the data no longer holds it, and with the new instance when ItemKeySelector moved the selection to a reloaded copy of it. Used by @bind-SelectedItem. |
| ViewChanged | EventCallback<DwsCalendarViewType> | Raised when the view on screen changes - through the view switcher, a drill-down or SetViewAsync - and when the calendar replaces a View that is not in Views. A handler that throws for such a correction is logged, so the calendar still loads its range. Used by @bind-View. |
| CurrentDateChanged | EventCallback<DateTime> | Raised when the calendar navigates to another date, and when it corrects CurrentDate: today for an unset value, the nearest date in 0002-01-01 to 9998-12-31 for one outside it. A handler that throws for such a correction is logged, so the calendar still loads its range. Used by @bind-CurrentDate. |
| OnDateRangeChanged | EventCallback<DwsCalendarDateRange> | Raised when the days on screen change - through navigation, a view change, or the first render. The DataLoader loads the new days whether or not the handler throws: raised by the first render or a parameter change, the exception is logged; on the user's navigation it propagates after the load. |
| OnCellClick | EventCallback<DwsCalendarCellEventArgs> | Raised when an empty time slot or day cell is clicked. |
| OnCellDoubleClick | EventCallback<DwsCalendarCellEventArgs> | Raised when an empty time slot or day cell is double-clicked, before the create popup opens. Set Cancel to keep it closed. The popup does not open when the user went on while an async handler ran - clicked something else, navigated or opened another popup - or when the slot is blocked by the time it finishes. |
| OnDateClick | EventCallback<DwsCalendarDateEventArgs> | Raised when a date label is clicked (day header, month-view date, quarter/year-view day, agenda date, timeline row label). Set Cancel to stop the drill-down into the day view; an async handler still running when the user went on does not drill down either. The labels are buttons only while a click on them does something - while this is set, or while DrillDownOnDateClick opens an enabled day view - and plain text otherwise, which a screen reader reads as the full date; in permission-selection (register) mode they are plain text too. |
| OnHeaderClick | EventCallback<DwsCalendarHeaderClickEventArgs> | Opt-in: raised when a header without a date of its own is clicked - a weekday name over the month view's grid, or a month's title in the quarter and year views, there before the drill-down into that month. The arguments carry Kind (DwsCalendarHeaderKind.Weekday or Month), DayOfWeek (the weekday clicked; null for a month title), Dates (every date of that weekday in the month on screen - not the neighbouring months' days that pad the grid - or every day of the clicked month, the first one first), View and Cancel, which stops the month's drill-down; an async handler still running when the user went on does not drill down either. The weekday names are buttons only while this is set, and a month title only while this is set or the month view is enabled; otherwise they are plain text, and in register mode too. |
| OnMoreClick | EventCallback<DwsCalendarMoreEventArgs<TItem>> | Raised when a day's "+ more" link is clicked, before the day's list popup opens. Set Cancel to keep it closed. An async handler still running when the user went on does not open it either, and the list leaves out appointments that went away meanwhile. Opened with Enter or Space, the list is centred in the viewport. |
| OnAppointmentClick | EventCallback<DwsCalendarAppointmentEventArgs<TItem>> | Raised when an appointment is clicked (or Enter or Space is pressed on it), before the details popup opens. Set Cancel to keep it closed. An async handler still running when the user went on - clicked something else, navigated or opened another popup - does not open it either, nor does one whose appointment went away meanwhile. The second click of a double click leaves the open details as they are, for the double click's editor. |
| OnAppointmentDoubleClick | EventCallback<DwsCalendarAppointmentEventArgs<TItem>> | Raised when an appointment is double-clicked - also in a day's "+ more" list - before the edit popup opens. Set Cancel to keep it closed; as for OnAppointmentClick, an async handler still running when the user went on does not open it. |
| OnAppointmentSelect | EventCallback<DwsCalendarAppointment<TItem>?> | Raised when the selected appointment changes; null when the selection is cleared. |
| OnAppointmentMouseEnter | EventCallback<DwsCalendarAppointmentEventArgs<TItem>> | Raised when the pointer enters an appointment. Only wired while set, so hovering costs nothing otherwise. |
| OnAppointmentMouseLeave | EventCallback<DwsCalendarAppointmentEventArgs<TItem>> | Raised when the pointer leaves an appointment. Only wired while set. |
| OnAppointmentRender | Action<DwsCalendarAppointmentRenderArgs<TItem>>? | Called synchronously while an appointment element is rendered, to add classes (CssClass), styles (Style), a tooltip (Tooltip) or an accessible name (AriaLabel). The element's name is by default its title, day and time - "Review, Monday, September 21, 2026, 9:00 AM – 10:00 AM" - and takes the place of whatever the element shows for a screen reader, so set AriaLabel when an AppointmentTemplate shows more than that (a category, a room, a state such as cancelled); empty or white space keeps the default. It runs for every appointment element on every render, so keep it cheap. |
| OnAppointmentMove | EventCallback<DwsCalendarAppointmentChangeEventArgs<TItem>> | Raised when an appointment is dropped somewhere new (or moved with Alt+Arrow - see EnableDragging - or by MoveAppointmentAsync), before it is written. Adjust the New* values or set Cancel; a NewEnd put before NewStart refuses the change too, and is logged. NewStart and NewEnd carry the DateTimeKind of the item's start. While an async handler runs, another change of the same item is refused, and after a drop the target stays highlighted and the appointment is marked as pending (the dws-calendar__appointment--pending class and aria-busy) until the handler has decided, each dropped appointment on its own. OnAppointmentChanged already sees it drawn at its new place. |
| OnAppointmentResize | EventCallback<DwsCalendarAppointmentChangeEventArgs<TItem>> | Raised when an appointment's end is dragged (or moved with Alt+Shift+Arrow - see EnableResizing), before it is written. Adjust the New* values or set Cancel; a NewEnd put before NewStart refuses the change too, and is logged. NewStart and NewEnd carry the DateTimeKind of the item's start. A dropped end is shown as pending while an async handler runs, as for OnAppointmentMove. |
| OnAppointmentUpdate | EventCallback<DwsCalendarAppointmentChangeEventArgs<TItem>> | Raised when the edit popup is saved, before the item is written. Adjust the New* values or set Cancel; a NewEnd put before NewStart refuses the change too, and is logged. NewStart and NewEnd carry the DateTimeKind of the item's start. While an async handler runs the Save button shows its loading state, saving again is ignored and the popup cannot be closed or cancelled, so a Cancel's message stays on screen. |
| OnAppointmentChanged | EventCallback<DwsCalendarAppointmentChangeEventArgs<TItem>> | Raised after a move, resize or edit was written to the item. The item is free for the next change by then, so the handler may change it again (e.g. MoveAppointmentAsync to snap it). |
| OnAppointmentCreating | EventCallback<DwsCalendarAppointmentCreateEventArgs<TItem>> | Raised when the create popup is saved, with the new item already filled in, before it is added. Set Cancel to drop it. Start and End carry the DateTimeKind the item holds its start in - Unspecified, unless ItemFactory set another. While an async handler runs the Save button shows its loading state, saving again is ignored and the popup cannot be closed or cancelled. |
| OnAppointmentCreated | EventCallback<TItem> | Raised after a new item was added. The create popup has closed by then (OnPopupClose comes first), so a handler that throws cannot leave it open for a second Save. |
| OnAppointmentDeleting | EventCallback<DwsCalendarAppointmentDeleteEventArgs<TItem>> | Raised before an appointment is deleted. Set Cancel to keep it. While an async handler runs, another delete or change of the same item is refused, and a confirmation popup cannot be closed or cancelled. |
| OnAppointmentDeleted | EventCallback<TItem> | Raised after an item was removed. |
| OnExternalDrop | EventCallback<DwsCalendarExternalDropEventArgs> | Raised when something from outside was dropped on a slot or day (AllowExternalDrop): the slot's Start and End (a day's midnights for a day cell), AllDay, the Group of its column or row, and the browser's DataTransfer - the kinds of data and the names of files, not the data itself (a browser hands that to script only; remember what is dragged in the source's dragstart). |
| OnPopupOpen | EventCallback<DwsCalendarPopupEventArgs<TItem>> | Raised when a popup opens - details, edit, create or a day's overflow list. Popups are modal and open in the browser's top layer, above everything the page puts around the calendar (a sticky header, a DwsDialog); a browser without popovers shows them in place. |
| OnPopupClose | EventCallback<DwsCalendarPopupEventArgs<TItem>> | Raised when a popup closes - by the user, ClosePopupAsync or another popup taking its place, and also when its appointment is deleted or disappears from the data, or when the calendar is hidden with Visible = false. Reports the kind the popup was opened as (an editor asking to confirm a delete is still Edit). A handler that throws for a popup a parameter change or a DataLoader result dropped is logged, so the calendar's update still completes. Escape closes a popup and goes no further: key presses inside a popup do not reach key handlers above the calendar, so a DwsDialog hosting it with CloseOnEscapeKey stays open. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Element | ElementReference | The associated web component. May be null if accessed before the component is rendered. | |
| ComponentGuid | Guid | Unique identifier for the component. | |
| TypeString | string | The name of the component type, obtained from reflection. | |
| Authorized_RegisterEnabled | bool | false | Indicates whether this component is enabled through a permission registry. |
| Authorized_RegisterSelected | bool | false | Indicates whether this component is selected in permission selection mode. |
| GetInitializedState | bool | false | Returns whether the component is initialized. |
| GetRenderModeState | DwsRenderMode | Returns the current render mode. | |
| GetComponentState | DwsComponentStateType | Returns the current component state. | |
| GetIsInteractiveState | bool | false | Returns whether the component is interactive. |
| GetIsPrerenderingState | bool | false | Returns whether the component is prerendering. |
| GetComponentLoadingState | bool | false | Returns whether the component is loading. |
| IsFormBusy | bool | false | Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState). |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| DebugInfo | void | Logs debug information about the component. | |
| UpdateState | void | Updates the component's state and triggers StateHasChanged. | |
| UpdateStateAsync | Task | Asynchronously updates the component's state and triggers StateHasChanged. | |
| Dispose | void | Disposes the component and releases resources. | |
| FocusAsync | ValueTask | bool containedInScrollableList | Sets focus to the component's element. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Name | string | Required unique identifier for the component within its container. | |
| Visible | bool | true | Determines if the component is visible in the UI. |
| Disabled | bool | false | Disables the form control, ensuring it doesn't participate in form submission. |
| ComponentNameSpace | string | The namespace for permission-based access control. | |
| PermissionKey | string? | null | A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins. |
| Class | string | Optional CSS class names. | |
| Style | string | Optional in-line styles. | |
| Tag | object | An optional user-defined object to store any additional data with the component. | |
| BackReference | DwsReference | A reference to the enclosing component. | |
| ID | string | The HTML ID attribute for the component. | |
| AdditionalAttributes | Dictionary<string, object> | Additional HTML attributes for the calendar's root element, a region landmark named "Calendar" (the localised Calendar_AccessibleLabel) by default. An aria-label passed here (e.g. "Room A bookings") names it instead, so a page with several calendars can tell them apart - the two in section 13 do; role and tabindex can be overridden too. id, class, style, aria-busy and the calendar's own event handlers (click, key, pointer, drag and drop) stay the calendar's: pass classes and styles through Class and Style. | |
| IgnorePermissionChecks | bool | false | Bypasses all permission checks for this component. |
| IgnorePermissionSelection | bool | false | Ignore permission selection mode for this component. |
| IgnoreFormBusy | bool | false | Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it. |
| Name | Typ | Description |
|---|---|---|
| OnInitializedCallbackStarted | EventCallback | Callback when OnInitialized starts. |
| OnInitializedCallback | EventCallback | Callback during OnInitialized. |
| OnInitializedCallbackCompleted | EventCallback | Callback when OnInitialized completes. |
| OnInitializedAsyncCallbackStarted | EventCallback | Callback when OnInitializedAsync starts. |
| OnInitializedAsyncCallback | EventCallback | Callback during OnInitializedAsync. |
| OnInitializedAsyncCallbackCompleted | EventCallback | Callback when OnInitializedAsync completes. |
| OnIsComponentLoadingChanged | EventCallback<bool> | Callback when IsComponentLoading changes. |
| OnCurrentRenderModeChanged | EventCallback<DwsRenderMode> | Callback when CurrentRenderMode changes. |
| OnComponentStateChanged | EventCallback<DwsComponentStateType> | Callback when ComponentState changes. |
