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.
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenDatePicker<TValue> : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent| Name | Description |
|---|---|
| TValue | The type of the date/time value. Supports DateTime, DateTime?, DateTimeOffset, DateTimeOffset?, DateOnly, and DateOnly?. |
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)" />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.
public RadzenDatePicker<TValue>()Gets or sets a value indicating whether value can be cleared.
public bool AllowClear { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether value can be cleared. |
Gets or sets a value indicating whether input is allowed.
public bool AllowInput { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether input is allowed. |
Gets or sets the button CSS class.
public string ButtonClass { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the button CSS class. |
Gets or sets the previous month aria label text.
public string CalendarWeekTitle { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the previous month aria label text. |
Gets or sets the change callback.
public EventCallback<DateTime?> Change { get; set; }
| Type | Description |
|---|---|
| EventCallback<DateTime?> | Gets or sets the change callback. |
Gets or sets the clear button aria label text.
public string ClearAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the clear button aria label text. |
Gets or set the current date changed callback.
public EventCallback<DateTime> CurrentDateChanged { get; set; }
| Type | Description |
|---|---|
| EventCallback<DateTime> | Gets or set the current date changed callback. |
Gets the current placeholder. Returns empty string if this component is inside a RadzenFormField.
protected string CurrentPlaceholder { get; }
| Type | Description |
|---|---|
| string | Gets the current placeholder. Returns empty string if this component is inside a RadzenFormField. |
Gets or sets the date format.
public string DateFormat { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the date format. |
Gets or sets the date render callback. Use it to set attributes.
public Action<DateRenderEventArgs> DateRender { get; set; }
| Type | Description |
|---|---|
| Action<DateRenderEventArgs> | Gets or sets the date render callback. Use it to set attributes. |
Gets or sets a value indicating whether this RadzenDatePicker<T> is disabled.
public bool Disabled { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether this RadzenDatePicker<T> is disabled. |
Gets or sets the edit context.
public Forms.EditContext EditContext { get; set; }
| Type | Description |
|---|---|
| Forms.EditContext | Gets or sets the edit context. |
Gets the field identifier.
public Forms.FieldIdentifier FieldIdentifier { get; set; }
| Type | Description |
|---|---|
| Forms.FieldIdentifier | Gets the field identifier. |
Gets or sets the form.
public IRadzenForm Form { get; set; }
| Type | Description |
|---|---|
| IRadzenForm | Gets or sets the form. |
Gets or sets the FormFieldContext of the component
public IFormFieldContext FormFieldContext { get; set; }
| Type | Description |
|---|---|
| IFormFieldContext | Gets or sets the FormFieldContext of the component |
Gets the formatted value.
public string FormattedValue { get; }
| Type | Description |
|---|---|
| string | Gets the formatted value. |
Gets a value indicating whether this instance has value.
public bool HasValue { get; }
| Type | Description |
|---|---|
| bool | Gets a value indicating whether this instance has value. |
Gets or sets the hour input aria label text.
public string HourAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the hour input aria label text. |
Gets or sets the hour format.
public string HourFormat { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the hour format. |
Gets or sets the hours step.
public string HoursStep { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the hours step. |
Gets or sets the Initial Date/Month View.
public DateTime? InitialViewDate { get; set; }
| Type | Description |
|---|---|
| DateTime? | Gets or sets the Initial Date/Month View. |
Gets or sets a value indicating whether this RadzenDatePicker<T> is inline - only Calender.
public bool Inline { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether this RadzenDatePicker<T> is inline - only Calender. |
Specifies additional custom attributes that will be rendered by the input.
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, object> | Specifies additional custom attributes that will be rendered by the input. |
Gets or sets the input CSS class.
public string InputClass { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the input CSS class. |
Gets a value indicating whether this instance is bound (ValueChanged callback has delegate).
public bool IsBound { get; }
| Type | Description |
|---|---|
| bool | Gets a value indicating whether this instance is bound (ValueChanged callback has delegate). |
Gets or sets the kind of DateTime bind to control
public DateTimeKind Kind { get; set; }
| Type | Description |
|---|---|
| DateTimeKind | Gets or sets the kind of DateTime bind to control |
Gets or sets the Maximum Selectable Date.
public DateTime? Max { get; set; }
| Type | Description |
|---|---|
| DateTime? | Gets or sets the Maximum Selectable Date. |
Gets or sets the Minimum Selectable Date.
public DateTime? Min { get; set; }
| Type | Description |
|---|---|
| DateTime? | Gets or sets the Minimum Selectable Date. |
Gets or sets the minutes input aria label text.
public string MinutesAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the minutes input aria label text. |
Gets or sets the minutes step.
public string MinutesStep { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the minutes step. |
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.
public bool Multiple { get; set; }
| Type | Description |
|---|---|
| bool | 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. |
Gets or sets the name of the form component.
public string Name { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the name of the form component. |
Gets or sets the next month aria label text.
public string NextMonthAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the next month aria label text. |
Gets or sets the OK button aria label text.
public string OkAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the OK button aria label text. |
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.
public EventCallback<DateTime?> OkClick { get; set; }
| 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. |
Gets or sets a value indicating whether the hour picker is padded with a leading zero.
public bool PadHours { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether the hour picker is padded with a leading zero. |
Gets or sets a value indicating whether the minute picker is padded with a leading zero.
public bool PadMinutes { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether the minute picker is padded with a leading zero. |
Gets or sets a value indicating whether the second picker is padded with a leading zero.
public bool PadSeconds { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether the second picker is padded with a leading zero. |
Parse the input using an function outside the Radzen-library
public Func<string, DateTime?> ParseInput { get; set; }
| Type | Description |
|---|---|
| Func<string, DateTime?> | Parse the input using an function outside the Radzen-library |
Gets or sets the input placeholder.
public string Placeholder { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the input placeholder. |
Gets or sets the popup aria label text.
public string PopupAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the popup aria label text. |
Gets or sets the render mode.
public PopupRenderMode PopupRenderMode { get; set; }
| Type | Description |
|---|---|
| PopupRenderMode | Gets or sets the render mode. |
Gets or sets the previous month aria label text.
public string PrevMonthAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the previous month aria label text. |
Gets or sets a value indicating whether read only.
public bool ReadOnly { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether read only. |
Gets or sets the seconds input aria label text.
public string SecondsAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the seconds input aria label text. |
Gets or sets the seconds step.
public string SecondsStep { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the seconds step. |
Gets or sets a value indicating whether popup datepicker button is shown.
public bool ShowButton { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether popup datepicker button is shown. |
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.
public bool ShowCalendarWeek { get; set; }
| Type | Description |
|---|---|
| bool | 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. |
Gets or sets a value indicating whether days part is shown.
public bool ShowDays { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether days part is shown. |
Gets or sets a value indicating whether hour is shown.
public bool ShowHour { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether hour is shown. |
Gets or sets a value indicating whether the input box is shown. Ignored if ShowButton is false.
public bool ShowInput { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether the input box is shown. Ignored if ShowButton is false. |
Gets or sets a value indicating whether minutes are shown.
public bool ShowMinutes { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether minutes are shown. |
Gets or sets a value indicating whether seconds are shown.
public bool ShowSeconds { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether seconds are shown. |
Gets or sets a value indicating whether time part is shown.
public bool ShowTime { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether time part is shown. |
Gets or sets a value indicating whether time ok button is shown.
public bool ShowTimeOkButton { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether time ok button is shown. |
Gets or sets the tab index.
public int TabIndex { get; set; }
| Type | Description |
|---|---|
| int | Gets or sets the tab index. |
Gets or sets a value indicating whether time only can be set.
public bool TimeOnly { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether time only can be set. |
Gets or sets the toggle Am/Pm aria label text.
public string ToggleAmPmAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the toggle Am/Pm aria label text. |
Gets or sets the toggle popup aria label text.
public string ToggleAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the toggle popup aria label text. |
Gets or sets the value.
public object Value { get; set; }
| Type | Description |
|---|---|
| object | Gets or sets the value. |
Gets or sets the value changed callback.
public EventCallback<TValue> ValueChanged { get; set; }
| Type | Description |
|---|---|
| EventCallback<TValue> | Gets or sets the value changed callback. |
Gets or sets the value expression.
public Expressions.Expression<Func<TValue>> ValueExpression { get; set; }
| Type | Description |
|---|---|
| Expressions.Expression<Func<TValue>> | Gets or sets the value expression. |
Gets ot sets the year format. Set to yyyy by default.
public string YearFormat { get; set; }
| Type | Description |
|---|---|
| string | Gets ot sets the year format. Set to yyyy by default. |
Gets or sets the year formatter. Set to FormatYear by default. If set, this function will take precedence over YearFormat.
public Func<int, string> YearFormatter { get; set; }
| 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. |
Gets or sets the year range.
public string YearRange { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the year range. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
Gets the value.
public object GetValue()
| Type | Description |
|---|---|
| object | System.Object. |
protected override Task OnAfterRenderAsync(bool firstRender)
| Type | Name | Description |
|---|---|---|
| bool | firstRender |
| Type | Description |
|---|---|
| Task |
Called from JavaScript when the popup is closed (e.g. by clicking outside) in Initial render mode.
public void OnPopupClose()public override Task SetParametersAsync(ParameterView parameters)
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters |
| Type | Description |
|---|---|
| Task |