RadzenDatePicker<TValue> Class

A date and time picker component that provides a calendar popup for selecting dates and optional time selection. RadzenDatePicker supports DateTime, DateTime?, DateTimeOffset, DateTimeOffset?, DateOnly, and DateOnly? types with extensive customization options. Displays a text input with a calendar icon button. Clicking opens a popup calendar for date selection. Optional time selection can be enabled via ShowTime property, supporting both 12-hour and 24-hour formats. Supports features like min/max date constraints, disabled dates, initial view configuration, calendar week display, inline calendar mode (always visible), time-only mode, multiple date selection, and culture-specific formatting.

Inheritance

Object

ComponentBase

RadzenComponent

RadzenDatePicker<TValue>

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormComponent

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenDatePicker<TValue> : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent

Type Parameters

Name Description
TValueThe type of the date/time value. Supports DateTime, DateTime?, DateTimeOffset, DateTimeOffset?, DateOnly, and DateOnly?.

Examples

Basic date picker:

<RadzenDatePicker @bind-Value=@birthDate TValue="DateTime" Placeholder="Select date" />

Date and time picker with 12-hour format:

<RadzenDatePicker @bind-Value=@appointmentDate TValue="DateTime" ShowTime="true" TimeOnly="false" HoursStep="1" MinutesStep="15" />

Date picker with constraints:

<RadzenDatePicker @bind-Value=@selectedDate TValue="DateTime" Min="@DateTime.Today" Max="@DateTime.Today.AddMonths(6)" />

Constructors

RadzenDatePicker<TValue>Link to this section

A date and time picker component that provides a calendar popup for selecting dates and optional time selection. RadzenDatePicker supports DateTime, DateTime?, DateTimeOffset, DateTimeOffset?, DateOnly, and DateOnly? types with extensive customization options. Displays a text input with a calendar icon button. Clicking opens a popup calendar for date selection. Optional time selection can be enabled via ShowTime property, supporting both 12-hour and 24-hour formats. Supports features like min/max date constraints, disabled dates, initial view configuration, calendar week display, inline calendar mode (always visible), time-only mode, multiple date selection, and culture-specific formatting.

Declaration
public RadzenDatePicker<TValue>()

Fields

inputLink to this section

Gets input reference.

Declaration
protected ElementReference input

Properties

AllowClearLink to this section

Gets or sets a value indicating whether value can be cleared.

Declaration
public bool AllowClear { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether value can be cleared.

AllowInputLink to this section

Gets or sets a value indicating whether input is allowed.

Declaration
public bool AllowInput { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether input is allowed.

ButtonClassLink to this section

Gets or sets the button CSS class.

Declaration
public string ButtonClass { get; set; }
Property Value
Type Description
stringGets or sets the button CSS class.

CalendarWeekTitleLink to this section

Gets or sets the previous month aria label text.

Declaration
public string CalendarWeekTitle { get; set; }
Property Value
Type Description
stringGets or sets the previous month aria label text.

ChangeLink to this section

Gets or sets the change callback.

Declaration
public EventCallback<DateTime?> Change { get; set; }
Property Value
Type Description
EventCallback<DateTime?>Gets or sets the change callback.

ClearAriaLabelLink to this section

Gets or sets the clear button aria label text.

Declaration
public string ClearAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the clear button aria label text.

CurrentDateChangedLink to this section

Gets or set the current date changed callback.

Declaration
public EventCallback<DateTime> CurrentDateChanged { get; set; }
Property Value
Type Description
EventCallback<DateTime>Gets or set the current date changed callback.

CurrentPlaceholderLink to this section

Gets the current placeholder. Returns empty string if this component is inside a RadzenFormField.

Declaration
protected string CurrentPlaceholder { get; }
Property Value
Type Description
stringGets the current placeholder. Returns empty string if this component is inside a RadzenFormField.

DateFormatLink to this section

Gets or sets the date format.

Declaration
public string DateFormat { get; set; }
Property Value
Type Description
stringGets or sets the date format.

DateRenderLink to this section

Gets or sets the date render callback. Use it to set attributes.

Declaration
public Action<DateRenderEventArgs> DateRender { get; set; }
Property Value
Type Description
Action<DateRenderEventArgs>Gets or sets the date render callback. Use it to set attributes.

DisabledLink to this section

Gets or sets a value indicating whether this RadzenDatePicker<T> is disabled.

Declaration
public bool Disabled { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether this RadzenDatePicker<T> is disabled.

DisabledAriaLabelLink to this section

Gets or sets the suffix appended to a day cell's aria label when the date is disabled.

Declaration
public string DisabledAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the suffix appended to a day cell's aria label when the date is disabled.

EditContextLink to this section

Gets or sets the edit context.

Declaration
public Forms.EditContext EditContext { get; set; }
Property Value
Type Description
Forms.EditContextGets or sets the edit context.

FieldIdentifierLink to this section

Gets the field identifier.

Declaration
public Forms.FieldIdentifier FieldIdentifier { get; set; }
Property Value
Type Description
Forms.FieldIdentifierGets the field identifier.

FooterTemplateLink to this section

Gets or sets the footer template.

Declaration
public RenderFragment FooterTemplate { get; set; }
Property Value
Type Description
RenderFragmentGets or sets the footer template.

FormLink to this section

Gets or sets the form.

Declaration
public IRadzenForm Form { get; set; }
Property Value
Type Description
IRadzenFormGets or sets the form.

FormFieldContextLink to this section

Gets or sets the FormFieldContext of the component

Declaration
public IFormFieldContext FormFieldContext { get; set; }
Property Value
Type Description
IFormFieldContextGets or sets the FormFieldContext of the component

FormattedValueLink to this section

Gets the formatted value.

Declaration
public string FormattedValue { get; }
Property Value
Type Description
stringGets the formatted value.

HasValueLink to this section

Gets a value indicating whether this instance has value.

Declaration
public bool HasValue { get; }
Property Value
Type Description
boolGets a value indicating whether this instance has value.

HourAriaLabelLink to this section

Gets or sets the hour input aria label text.

Declaration
public string HourAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the hour input aria label text.

HourFormatLink to this section

Gets or sets the hour format.

Declaration
public string HourFormat { get; set; }
Property Value
Type Description
stringGets or sets the hour format.

HoursStepLink to this section

Gets or sets the hours step.

Declaration
public string HoursStep { get; set; }
Property Value
Type Description
stringGets or sets the hours step.

ImmediateLink to this section

Gets or sets a value indicating whether the component should update its value on every input event rather than waiting for the input to lose focus (onchange event). When enabled, the bound value is updated as the user types, provided the input can be parsed as a valid date. Invalid intermediate input is ignored to avoid clearing the value while the user is still typing.

Declaration
public bool Immediate { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether the component should update its value on every input event rather than waiting for the input to lose focus (onchange event). When enabled, the bound value is updated as the user types, provided the input can be parsed as a valid date. Invalid intermediate input is ignored to avoid clearing the value while the user is still typing.

InitialViewDateLink to this section

Gets or sets the Initial Date/Month View.

Declaration
public DateTime? InitialViewDate { get; set; }
Property Value
Type Description
DateTime?Gets or sets the Initial Date/Month View.

InlineLink to this section

Gets or sets a value indicating whether this RadzenDatePicker<T> is inline - only Calender.

Declaration
public bool Inline { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether this RadzenDatePicker<T> is inline - only Calender.

InputAttributesLink to this section

Specifies additional custom attributes that will be rendered by the input.

Declaration
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
Property Value
Type Description
IReadOnlyDictionary<string, object>Specifies additional custom attributes that will be rendered by the input.

InputClassLink to this section

Gets or sets the input CSS class.

Declaration
public string InputClass { get; set; }
Property Value
Type Description
stringGets or sets the input CSS class.

InputSizeLink to this section

Gets or sets the size of the component.

Declaration
public InputSize InputSize { get; set; }
Property Value
Type Description
InputSizeGets or sets the size of the component.

IsBoundLink to this section

Gets a value indicating whether this instance is bound (ValueChanged callback has delegate).

Declaration
public bool IsBound { get; }
Property Value
Type Description
boolGets a value indicating whether this instance is bound (ValueChanged callback has delegate).

KindLink to this section

Gets or sets the kind of DateTime bind to control

Declaration
public DateTimeKind Kind { get; set; }
Property Value
Type Description
DateTimeKindGets or sets the kind of DateTime bind to control

MaxLink to this section

Gets or sets the Maximum Selectable Date.

Declaration
public DateTime? Max { get; set; }
Property Value
Type Description
DateTime?Gets or sets the Maximum Selectable Date.

MinLink to this section

Gets or sets the Minimum Selectable Date.

Declaration
public DateTime? Min { get; set; }
Property Value
Type Description
DateTime?Gets or sets the Minimum Selectable Date.

MinutesAriaLabelLink to this section

Gets or sets the minutes input aria label text.

Declaration
public string MinutesAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the minutes input aria label text.

MinutesStepLink to this section

Gets or sets the minutes step.

Declaration
public string MinutesStep { get; set; }
Property Value
Type Description
stringGets or sets the minutes step.

MultipleLink to this section

Gets or sets whether multiple dates can be selected. When enabled, users can select multiple dates from the calendar, and the value will be a collection of DateTimes.

Declaration
public bool Multiple { get; set; }
Property Value
Type Description
boolGets or sets whether multiple dates can be selected. When enabled, users can select multiple dates from the calendar, and the value will be a collection of DateTimes.

NameLink to this section

Gets or sets the name of the form component.

Declaration
public string Name { get; set; }
Property Value
Type Description
stringGets or sets the name of the form component.

NextMonthAriaLabelLink to this section

Gets or sets the next month aria label text.

Declaration
public string NextMonthAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the next month aria label text.

OkAriaLabelLink to this section

Gets or sets the OK button aria label text.

Declaration
public string OkAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the OK button aria label text.

OkClickLink to this section

Gets or sets the OK click callback. Fires only when the user clicks the OK button (visible when ShowTimeOkButton is true), allowing developers to distinguish between intermediate day-selection changes and the final user confirmation.

Declaration
public EventCallback<DateTime?> OkClick { get; set; }
Property Value
Type Description
EventCallback<DateTime?>Gets or sets the OK click callback. Fires only when the user clicks the OK button (visible when ShowTimeOkButton is true), allowing developers to distinguish between intermediate day-selection changes and the final user confirmation.

PadHoursLink to this section

Gets or sets a value indicating whether the hour picker is padded with a leading zero.

Declaration
public bool PadHours { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether the hour picker is padded with a leading zero.

PadMinutesLink to this section

Gets or sets a value indicating whether the minute picker is padded with a leading zero.

Declaration
public bool PadMinutes { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether the minute picker is padded with a leading zero.

PadSecondsLink to this section

Gets or sets a value indicating whether the second picker is padded with a leading zero.

Declaration
public bool PadSeconds { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether the second picker is padded with a leading zero.

ParseInputLink to this section

Parse the input using an function outside the Radzen-library

Declaration
public Func<string, DateTime?> ParseInput { get; set; }
Property Value
Type Description
Func<string, DateTime?>Parse the input using an function outside the Radzen-library

PlaceholderLink to this section

Gets or sets the input placeholder.

Declaration
public string Placeholder { get; set; }
Property Value
Type Description
stringGets or sets the input placeholder.

PopupAriaLabelLink to this section

Gets or sets the popup aria label text.

Declaration
public string PopupAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the popup aria label text.

PopupRenderModeLink to this section

Gets or sets the render mode.

Declaration
public PopupRenderMode PopupRenderMode { get; set; }
Property Value
Type Description
PopupRenderModeGets or sets the render mode.

PrevMonthAriaLabelLink to this section

Gets or sets the previous month aria label text.

Declaration
public string PrevMonthAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the previous month aria label text.

ReadOnlyLink to this section

Gets or sets a value indicating whether read only.

Declaration
public bool ReadOnly { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether read only.

SecondsAriaLabelLink to this section

Gets or sets the seconds input aria label text.

Declaration
public string SecondsAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the seconds input aria label text.

SecondsStepLink to this section

Gets or sets the seconds step.

Declaration
public string SecondsStep { get; set; }
Property Value
Type Description
stringGets or sets the seconds step.

SelectedAriaLabelLink to this section

Gets or sets the suffix appended to a day cell's aria label when the date is selected.

Declaration
public string SelectedAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the suffix appended to a day cell's aria label when the date is selected.

ShowButtonLink to this section

Gets or sets a value indicating whether popup datepicker button is shown.

Declaration
public bool ShowButton { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether popup datepicker button is shown.

ShowCalendarWeekLink to this section

Gets or sets whether the calendar week number column should be displayed in the calendar popup. When enabled, each week row shows its corresponding week number according to ISO 8601.

Declaration
public bool ShowCalendarWeek { get; set; }
Property Value
Type Description
boolGets or sets whether the calendar week number column should be displayed in the calendar popup. When enabled, each week row shows its corresponding week number according to ISO 8601.

ShowDaysLink to this section

Gets or sets a value indicating whether days part is shown.

Declaration
public bool ShowDays { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether days part is shown.

ShowHourLink to this section

Gets or sets a value indicating whether hour is shown.

Declaration
public bool ShowHour { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether hour is shown.

ShowInputLink to this section

Gets or sets a value indicating whether the input box is shown. Ignored if ShowButton is false.

Declaration
public bool ShowInput { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether the input box is shown. Ignored if ShowButton is false.

ShowMinutesLink to this section

Gets or sets a value indicating whether minutes are shown.

Declaration
public bool ShowMinutes { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether minutes are shown.

ShowSecondsLink to this section

Gets or sets a value indicating whether seconds are shown.

Declaration
public bool ShowSeconds { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether seconds are shown.

ShowTimeLink to this section

Gets or sets a value indicating whether time part is shown.

Declaration
public bool ShowTime { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether time part is shown.

ShowTimeOkButtonLink to this section

Gets or sets a value indicating whether time ok button is shown.

Declaration
public bool ShowTimeOkButton { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether time ok button is shown.

TabIndexLink to this section

Gets or sets the tab index.

Declaration
public int TabIndex { get; set; }
Property Value
Type Description
intGets or sets the tab index.

TimeOnlyLink to this section

Gets or sets a value indicating whether time only can be set.

Declaration
public bool TimeOnly { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether time only can be set.

TodayAriaLabelLink to this section

Gets or sets the suffix appended to a day cell's aria label when the date is today.

Declaration
public string TodayAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the suffix appended to a day cell's aria label when the date is today.

ToggleAmPmAriaLabelLink to this section

Gets or sets the toggle Am/Pm aria label text.

Declaration
public string ToggleAmPmAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the toggle Am/Pm aria label text.

ToggleAriaLabelLink to this section

Gets or sets the toggle popup aria label text.

Declaration
public string ToggleAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the toggle popup aria label text.

ValueLink to this section

Gets or sets the value.

Declaration
public object Value { get; set; }
Property Value
Type Description
objectGets or sets the value.

ValueChangedLink to this section

Gets or sets the value changed callback.

Declaration
public EventCallback<TValue> ValueChanged { get; set; }
Property Value
Type Description
EventCallback<TValue>Gets or sets the value changed callback.

ValueExpressionLink to this section

Gets or sets the value expression.

Declaration
public Expressions.Expression<Func<TValue>> ValueExpression { get; set; }
Property Value
Type Description
Expressions.Expression<Func<TValue>>Gets or sets the value expression.

YearFormatLink to this section

Gets ot sets the year format. Set to yyyy by default.

Declaration
public string YearFormat { get; set; }
Property Value
Type Description
stringGets ot sets the year format. Set to yyyy by default.

YearFormatterLink to this section

Gets or sets the year formatter. Set to FormatYear by default. If set, this function will take precedence over YearFormat.

Declaration
public Func<int, string> YearFormatter { get; set; }
Property Value
Type Description
Func<int, string>Gets or sets the year formatter. Set to FormatYear by default. If set, this function will take precedence over YearFormat.

YearRangeLink to this section

Gets or sets the year range.

Declaration
public string YearRange { get; set; }
Property Value
Type Description
stringGets or sets the year range.

Methods

BuildRenderTreeLink to this section

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

CloseLink to this section

Closes this instance popup.

Declaration
public void Close()

DisposeLink to this section

Declaration
public override void Dispose()

FocusAsyncLink to this section

Declaration
public ValueTask FocusAsync()
Returns
Type Description
ValueTask

GetComponentCssClassLink to this section

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

GetValueLink to this section

Gets the value.

Declaration
public object GetValue()
Returns
Type Description
objectSystem.Object.

OnAfterRenderAsyncLink to this section

Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type Name Description
bool firstRender
Returns
Type Description
Task

OnInitializedLink to this section

Declaration
protected override void OnInitialized()

OnPopupCloseLink to this section

Called from JavaScript when the popup is closed (e.g. by clicking outside) in Initial render mode.

Declaration
public void OnPopupClose()

ParseDateLink to this section

Parses the date.

Declaration
protected Task ParseDate()
Returns
Type Description
Task

ParseDateImmediateLink to this section

Parses the date on input. Ignores invalid intermediate input to avoid clearing the value while the user is typing.

Declaration
protected Task ParseDateImmediate()
Returns
Type Description
Task

SetParametersAsyncLink to this section

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
Task
An error has occurred. This app may no longer respond until reloaded. Reload 🗙