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

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

Gets input reference.

Declaration
protected ElementReference input

Properties

AllowClearlink

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

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

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

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

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

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

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

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

Gets or sets the date format.

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

DateRenderlink

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

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.

EditContextlink

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

Gets the field identifier.

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

FooterTemplatelink

Gets or sets the footer template.

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

Formlink

Gets or sets the form.

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

FormFieldContextlink

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

Gets the formatted value.

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

HasValuelink

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

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

Gets or sets the hour format.

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

HoursSteplink

Gets or sets the hours step.

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

InitialViewDatelink

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

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

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

Gets or sets the input CSS class.

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

IsBoundlink

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

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

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

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

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

Gets or sets the minutes step.

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

Multiplelink

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

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

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

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

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

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

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

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

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

Gets or sets the input placeholder.

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

PopupAriaLabellink

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

Gets or sets the render mode.

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

PrevMonthAriaLabellink

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

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

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

Gets or sets the seconds step.

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

ShowButtonlink

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

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

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

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

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

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

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

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

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

Gets or sets the tab index.

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

TimeOnlylink

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.

ToggleAmPmAriaLabellink

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

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

Gets or sets the value.

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

ValueChangedlink

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

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

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

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

Gets or sets the year range.

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

Methods

BuildRenderTreelink

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

Closelink

Closes this instance popup.

Declaration
public void Close()

Disposelink

Declaration
public override void Dispose()

FocusAsynclink

Declaration
public ValueTask FocusAsync()
Returns
Type Description
ValueTask

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

GetValuelink

Gets the value.

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

OnAfterRenderAsynclink

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

OnInitializedlink

Declaration
protected override void OnInitialized()

OnPopupCloselink

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

Declaration
public void OnPopupClose()

ParseDatelink

Parses the date.

Declaration
protected Task ParseDate()
Returns
Type Description
Task

SetParametersAsynclink

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 🗙