Class RadzenScheduler<TItem>
A scheduler component for displaying and managing calendar appointments in multiple view types (day, week, month, year). RadzenScheduler provides a rich calendar interface with drag-and-drop, inline editing, recurring events, and customizable views. Displays time-based events in various calendar views, ideal for appointment booking, event calendars, resource scheduling, or any time-based data visualization. Features multiple views (Day, Week, Month, Year Planner, Year Timeline), drag & drop to move appointments between time slots, resize to adjust appointment duration by dragging edges, inline editing to create and edit appointments directly in the calendar, tooltips for quick info on hover, customizable appointment templates, support for all-day and multi-day events, and timezone-aware appointments. Define data properties using StartProperty, EndProperty, and TextProperty. Add view components (RadzenDayView, RadzenWeekView, RadzenMonthView) as child content.
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenScheduler<TItem> : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IScheduler
Type Parameters
| Name | Description |
|---|---|
| TItem | The type of appointment data items. Must have DateTime properties for start/end times and a string property for text. |
Examples
Basic scheduler with month view:
<RadzenScheduler Data=@appointments TItem="Appointment" StartProperty="Start" EndProperty="End" TextProperty="Title">
<RadzenMonthView />
<RadzenWeekView />
<RadzenDayView />
</RadzenScheduler>
@code {
class Appointment
{
public DateTime Start { get; set; }
public DateTime End { get; set; }
public string Title { get; set; }
}
List<Appointment> appointments = new();
}
Scheduler with editing and custom template:
<RadzenScheduler Data=@appointments TItem="Appointment"
StartProperty="Start" EndProperty="End" TextProperty="Title"
SlotSelect=@OnSlotSelect AppointmentSelect=@OnAppointmentSelect>
<Template Context="appointment">
<strong>@appointment.Title</strong>
<div>@appointment.Description</div>
</Template>
<RadzenWeekView />
</RadzenScheduler>
Constructors
RadzenScheduler()
A scheduler component for displaying and managing calendar appointments in multiple view types (day, week, month, year). RadzenScheduler provides a rich calendar interface with drag-and-drop, inline editing, recurring events, and customizable views. Displays time-based events in various calendar views, ideal for appointment booking, event calendars, resource scheduling, or any time-based data visualization. Features multiple views (Day, Week, Month, Year Planner, Year Timeline), drag & drop to move appointments between time slots, resize to adjust appointment duration by dragging edges, inline editing to create and edit appointments directly in the calendar, tooltips for quick info on hover, customizable appointment templates, support for all-day and multi-day events, and timezone-aware appointments. Define data properties using StartProperty, EndProperty, and TextProperty. Add view components (RadzenDayView, RadzenWeekView, RadzenMonthView) as child content.
Declaration
public RadzenScheduler()
Examples
Basic scheduler with month view:
<RadzenScheduler Data=@appointments TItem="Appointment" StartProperty="Start" EndProperty="End" TextProperty="Title">
<RadzenMonthView />
<RadzenWeekView />
<RadzenDayView />
</RadzenScheduler>
@code {
class Appointment
{
public DateTime Start { get; set; }
public DateTime End { get; set; }
public string Title { get; set; }
}
List<Appointment> appointments = new();
}
Scheduler with editing and custom template:
<RadzenScheduler Data=@appointments TItem="Appointment"
StartProperty="Start" EndProperty="End" TextProperty="Title"
SlotSelect=@OnSlotSelect AppointmentSelect=@OnAppointmentSelect>
<Template Context="appointment">
<strong>@appointment.Title</strong>
<div>@appointment.Description</div>
</Template>
<RadzenWeekView />
</RadzenScheduler>
Properties
AppointmentMouseEnter
A callback that will be invoked when the user moves the mouse over an appointment in the current view.
Declaration
[Parameter]
public EventCallback<SchedulerAppointmentMouseEventArgs<TItem>> AppointmentMouseEnter { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SchedulerAppointmentMouseEventArgs<TItem>> |
AppointmentMouseLeave
A callback that will be invoked when the user moves the mouse out of an appointment in the current view.
Declaration
[Parameter]
public EventCallback<SchedulerAppointmentMouseEventArgs<TItem>> AppointmentMouseLeave { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SchedulerAppointmentMouseEventArgs<TItem>> |
AppointmentMove
A callback that will be invoked when an appointment is being dragged and then dropped on a different slot. Commonly used to change it to a different timeslot.
Declaration
[Parameter]
public EventCallback<SchedulerAppointmentMoveEventArgs> AppointmentMove { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SchedulerAppointmentMoveEventArgs> |
Examples
<RadzenScheduler Data=@appointments AppointmentMove=@OnAppointmentMove>
</RadzenScheduler>
@code {
async Task OnAppointmentMove(SchedulerAppointmentMoveEventArgs moved)
{
var draggedAppointment = appointments.SingleOrDefault(x => x == (Appointment)moved.Appointment.Data);
if (draggedAppointment != null)
{
draggedAppointment.Start = draggedAppointment.Start + moved.TimeSpan;
draggedAppointment.End = draggedAppointment.End + moved.TimeSpan;
await scheduler.Reload();
}
}
}
AppointmentRender
An action that will be invoked when the current view renders an appointment. Never call StateHasChanged when handling AppointmentRender.
Declaration
[Parameter]
public Action<SchedulerAppointmentRenderEventArgs<TItem>> AppointmentRender { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<SchedulerAppointmentRenderEventArgs<TItem>> |
Examples
<RadzenScheduler Data=@appointments AppointmentRender=@OnAppointmentRendert>
</RadzenScheduler>
@code {
void OnAppintmentRender(SchedulerAppointmentRenderEventArgs<TItem> args)
{
if (args.Data.Text == "Birthday")
{
args.Attributes["style"] = "color: red;"
}
. }
}
AppointmentSelect
A callback that will be invoked when the user clicks an appointment in the current view. Commonly used to edit existing appointments.
Declaration
[Parameter]
public EventCallback<SchedulerAppointmentSelectEventArgs<TItem>> AppointmentSelect { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SchedulerAppointmentSelectEventArgs<TItem>> |
Examples
<RadzenScheduler Data=@appointments AppointmentSelect=@OnAppointmentSelect>
</RadzenScheduler>
@code {
void OnAppointmentSelect(SchedulerAppointmentSelectEventArgs<TItem> args)
{
}
}
ChildContent
Gets or sets the child content of the scheduler. Use to specify what views to render.
Declaration
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment | The child content. |
CurrentDate
Gets or sets the current date displayed by the selected view. Initially set to Date. Changes during navigation.
Declaration
public DateTime CurrentDate { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime | The current date. |
Data
Gets or sets the data of RadzenScheduler. It will display an appointment for every item of the collection which is within the current view date range.
Declaration
[Parameter]
public IEnumerable<TItem> Data { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<TItem> | The data. |
Date
Gets or sets the initial date displayed by the selected view. Set to DateTime.Today by default.
Declaration
[Parameter]
public DateTime Date { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime | The date. |
DaySelect
A callback that will be invoked when the user clicks a day header button or the day number in a MonthView.
Declaration
[Parameter]
public EventCallback<SchedulerDaySelectEventArgs> DaySelect { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SchedulerDaySelectEventArgs> |
Examples
<RadzenScheduler Data=@appointments DaySelect=@OnDaySelect>
</RadzenScheduler>
@code {
void OnDaySelect(SchedulerDaySelectEventArgs args)
{
var selectedDay = args.Day;
}
}
EndProperty
Specifies the property of TItem which will set End.
Declaration
[Parameter]
public string EndProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The name of the property. Must be a |
LoadData
A callback that will be invoked when the scheduler needs data for the current view. Commonly used to filter the data assigned to Data.
Declaration
[Parameter]
public EventCallback<SchedulerLoadDataEventArgs> LoadData { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SchedulerLoadDataEventArgs> |
MonthSelect
A callback that will be invoked when the user clicks a month header button.
Declaration
[Parameter]
public EventCallback<SchedulerMonthSelectEventArgs> MonthSelect { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SchedulerMonthSelectEventArgs> |
Examples
<RadzenScheduler Data=@appointments MonthSelect=@OnMonthSelect>
</RadzenScheduler>
@code {
void OnMonthSelect(SchedulerMonthSelectEventArgs args)
{
var selectedMonth = args.MonthStart.Month;
}
}
MoreSelect
A callback that will be invoked when the user clicks the more text in the current view. Commonly used to view additional appointments. Invoke the PreventDefault() method to prevent the default action (showing the additional appointments).
Declaration
[Parameter]
public EventCallback<SchedulerMoreSelectEventArgs> MoreSelect { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SchedulerMoreSelectEventArgs> |
Examples
<RadzenScheduler Data=@appointments MoreSelect=@OnMoreSelect>
</RadzenScheduler>
@code {
void OnMoreSelect(SchedulerMoreSelectEventArgs args)
{
args.PreventDefault();
}
}
NavigationTemplate
Gets or sets the additional content to be rendered in place of the default navigation buttons in the scheduler.
This property allows for complete customization of the navigation controls, replacing the native date navigation buttons (such as year, month, and day) with user-defined content or buttons.
Use this to add custom controls or interactive elements that better suit your application's requirements.
This requires that the ShowHeader parameter to be set to true (enabled by default).
Declaration
[Parameter]
public RenderFragment NavigationTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment | The custom navigation template to replace default navigation buttons. |
NextText
Gets or sets the text of the next button. Set to Next by default.
Declaration
[Parameter]
public string NextText { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The next text. |
PrevText
Gets or sets the text of the previous button. Set to Previous by default.
Declaration
[Parameter]
public string PrevText { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The previous text. |
SelectedIndex
Specifies the initially selected view.
Declaration
[Parameter]
public int SelectedIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The index of the selected. |
SelectedView
Gets the SelectedView.
Declaration
public ISchedulerView SelectedView { get; }
Property Value
| Type | Description |
|---|---|
| ISchedulerView |
ShowHeader
Specifies whether to Show or Hide the Scheduler Header. Defaults to true />.
Declaration
[Parameter]
public bool ShowHeader { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | Show / hide header |
SlotRender
An action that will be invoked when the current view renders an slot. Never call StateHasChanged when handling SlotRender.
Declaration
[Parameter]
public Action<SchedulerSlotRenderEventArgs> SlotRender { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<SchedulerSlotRenderEventArgs> |
Examples
<RadzenScheduler Data=@appointments SlotRender=@OnSlotRender>
</RadzenScheduler>
@code {
void OnSlotRender(SchedulerSlotRenderEventArgs args)
{
if (args.View.Text == "Month" && args.Start.Date == DateTime.Today)
{
args.Attributes["style"] = "background: red;";
}
}
}
SlotSelect
A callback that will be invoked when the user clicks a slot in the current view. Commonly used to add new appointments.
Declaration
[Parameter]
public EventCallback<SchedulerSlotSelectEventArgs> SlotSelect { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SchedulerSlotSelectEventArgs> |
Examples
<RadzenScheduler Data=@appointments SlotSelect=@OnSlotSelect>
</RadzenScheduler>
@code {
void OnSlotSelect(SchedulerSlotSelectEventArgs args)
{
}
}
StartProperty
Specifies the property of TItem which will set Start.
Declaration
[Parameter]
public string StartProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The name of the property. Must be a |
Template
Gets or sets the template used to render appointments.
Declaration
[Parameter]
public RenderFragment<TItem> Template { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment<TItem> | The template. |
Examples
<RadzenScheduler Data="@data" TItem="DataItem" StartProperty="Start" EndProperty="End" TextProperty="Text">
<Template Context="data">
<strong>@data.Text</strong>
</Template>
<ChildContent>
<RadzenMonthView />
</ChildContent>
</RadzenScheduler>
TextProperty
Specifies the property of TItem which will set Text.
Declaration
[Parameter]
public string TextProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The name of the property. Must be a |
TodaySelect
A callback that will be invoked when the user clicks the Today button.
Declaration
[Parameter]
public EventCallback<SchedulerTodaySelectEventArgs> TodaySelect { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SchedulerTodaySelectEventArgs> |
Examples
<RadzenScheduler Data=@appointments TodaySelect=@OnTodaySelect>
</RadzenScheduler>
@code {
void OnTodaySelect(SchedulerTodaySelectEventArgs args)
{
args.Today = DateTime.Today.AddDays(1);
}
}
TodayText
Gets or sets the text of the today button. Set to Today by default.
Declaration
[Parameter]
public string TodayText { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The today text. |
Methods
AddView(ISchedulerView)
Adds a view. Must be called when a ISchedulerView is initialized.
Declaration
public Task AddView(ISchedulerView view)
Parameters
| Type | Name | Description |
|---|---|---|
| ISchedulerView | view | The view to add. |
Returns
| Type | Description |
|---|---|
| Task |
BuildRenderTree(RenderTreeBuilder)
A scheduler component for displaying and managing calendar appointments in multiple view types (day, week, month, year). RadzenScheduler provides a rich calendar interface with drag-and-drop, inline editing, recurring events, and customizable views. Displays time-based events in various calendar views, ideal for appointment booking, event calendars, resource scheduling, or any time-based data visualization. Features multiple views (Day, Week, Month, Year Planner, Year Timeline), drag & drop to move appointments between time slots, resize to adjust appointment duration by dragging edges, inline editing to create and edit appointments directly in the calendar, tooltips for quick info on hover, customizable appointment templates, support for all-day and multi-day events, and timezone-aware appointments. Define data properties using StartProperty, EndProperty, and TextProperty. Add view components (RadzenDayView, RadzenWeekView, RadzenMonthView) as child content.
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
Dispose()
Detaches event handlers and disposes Reference.
Declaration
public override void Dispose()
Overrides
GetAppointmentAttributes(AppointmentData)
Gets the appointment HTML attributes.
Declaration
public IDictionary<string, object> GetAppointmentAttributes(AppointmentData item)
Parameters
| Type | Name | Description |
|---|---|---|
| AppointmentData | item | The appointment. |
Returns
| Type | Description |
|---|---|
| IDictionary<string, object> | A dictionary containing the HTML attributes for the specified appointment. |
GetAppointmentsInRange(DateTime, DateTime)
Gets the appointments in the specified range.
Declaration
public IEnumerable<AppointmentData> GetAppointmentsInRange(DateTime start, DateTime end)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | start | The start of the range. |
| DateTime | end | The end of the range. |
Returns
| Type | Description |
|---|---|
| IEnumerable<AppointmentData> | A collection of appointments within the specified range. |
GetComponentCssClass()
Gets the component CSS class.
Declaration
protected override string GetComponentCssClass()
Returns
| Type | Description |
|---|---|
| string |
Overrides
GetSlotAttributes(DateTime, DateTime, Func<IEnumerable<AppointmentData>>)
Gets the slot HTML attributes.
Declaration
public IDictionary<string, object> GetSlotAttributes(DateTime start, DateTime end, Func<IEnumerable<AppointmentData>> getAppointments)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | start | The start of the slot. |
| DateTime | end | The end of the slot. |
| Func<IEnumerable<AppointmentData>> | getAppointments | Function to return appointments for this range. |
Returns
| Type | Description |
|---|---|
| IDictionary<string, object> | A dictionary containing the HTML attributes for the specified slot. |
IsAppointmentInRange(AppointmentData, DateTime, DateTime)
Determines whether an appointment is within the specified range.
Declaration
public bool IsAppointmentInRange(AppointmentData item, DateTime start, DateTime end)
Parameters
| Type | Name | Description |
|---|---|---|
| AppointmentData | item | The appointment to check. |
| DateTime | start | The start of the range. |
| DateTime | end | The end of the range. |
Returns
| Type | Description |
|---|---|
| bool |
|
IsSelected(ISchedulerView)
Determines whether the specified view is selected.
Declaration
public bool IsSelected(ISchedulerView view)
Parameters
| Type | Name | Description |
|---|---|---|
| ISchedulerView | view | The view. |
Returns
| Type | Description |
|---|---|
| bool |
|
OnAfterRenderAsync(bool)
Called by the Blazor runtime.
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | firstRender |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
OnInitialized()
Called by the Blazor runtime.
Declaration
protected override void OnInitialized()
Overrides
Reload()
Causes the current scheduler view to render. Enumerates the items of Data and creates instances of AppointmentData to display in the current view. Use it when Data has changed.
Declaration
public Task Reload()
Returns
| Type | Description |
|---|---|
| Task |
RemoveView(ISchedulerView)
Removes a view. Must be called when a ISchedulerView is disposed.
Declaration
public void RemoveView(ISchedulerView view)
Parameters
| Type | Name | Description |
|---|---|---|
| ISchedulerView | view | The view to remove. |
RenderAppointment(AppointmentData)
Renders the appointment.
Declaration
public RenderFragment RenderAppointment(AppointmentData item)
Parameters
| Type | Name | Description |
|---|---|---|
| AppointmentData | item | The item. |
Returns
| Type | Description |
|---|---|
| RenderFragment | RenderFragment. |
Resize(double, double)
Invoked from client-side via interop when the scheduler size changes.
Declaration
[JSInvokable]
public void Resize(double width, double height)
Parameters
| Type | Name | Description |
|---|---|---|
| double | width | The width. |
| double | height | The height. |
SelectAppointment(AppointmentData)
Selects the specified appointment.
Declaration
public Task SelectAppointment(AppointmentData data)
Parameters
| Type | Name | Description |
|---|---|---|
| AppointmentData | data | The appointment to select. |
Returns
| Type | Description |
|---|---|
| Task |
SelectDay(DateTime, IEnumerable<AppointmentData>)
Selects the specified day.
Declaration
public Task SelectDay(DateTime day, IEnumerable<AppointmentData> appointments)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | day | The selected day. |
| IEnumerable<AppointmentData> | appointments | The appointments for this range. |
Returns
| Type | Description |
|---|---|
| Task |
SelectMonth(DateTime, IEnumerable<AppointmentData>)
Selects the specified month.
Declaration
public Task SelectMonth(DateTime monthStart, IEnumerable<AppointmentData> appointments)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | monthStart | The start of the month. |
| IEnumerable<AppointmentData> | appointments | The appointments for this range. |
Returns
| Type | Description |
|---|---|
| Task |
SelectMore(DateTime, DateTime, IEnumerable<AppointmentData>)
Selects the specified more link.
Declaration
public Task<bool> SelectMore(DateTime start, DateTime end, IEnumerable<AppointmentData> appointments)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | start | The start. |
| DateTime | end | The end. |
| IEnumerable<AppointmentData> | appointments | The appointments for this range. |
Returns
| Type | Description |
|---|---|
| Task<bool> |
SelectSlot(DateTime, DateTime)
Selects the specified slot.
Declaration
public Task SelectSlot(DateTime start, DateTime end)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | start | The start. |
| DateTime | end | The end. |
Returns
| Type | Description |
|---|---|
| Task |
SelectSlot(DateTime, DateTime, IEnumerable<AppointmentData>)
Selects the specified slot.
Declaration
public Task<bool> SelectSlot(DateTime start, DateTime end, IEnumerable<AppointmentData> appointments)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | start | The start. |
| DateTime | end | The end. |
| IEnumerable<AppointmentData> | appointments | The appointments for this range. |
Returns
| Type | Description |
|---|---|
| Task<bool> |
SelectView(ISchedulerView)
Selects the specified ISchedulerView. The view must already be present in this scheduler. If the specified view is already selected, no action will be performed.
Declaration
public Task SelectView(ISchedulerView view)
Parameters
| Type | Name | Description |
|---|---|---|
| ISchedulerView | view | The ISchedulerView to select |
Returns
| Type | Description |
|---|---|
| Task |
SetParametersAsync(ParameterView)
Called by the Blazor runtime when parameters are set.
Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters | The parameters. |
Returns
| Type | Description |
|---|---|
| Task |