Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class RadzenDatePicker<TValue>

    RadzenDatePicker component.

    Inheritance
    object
    ComponentBase
    RadzenComponent
    RadzenDatePicker<TValue>
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    IRadzenFormComponent
    Inherited Members
    RadzenComponent.OnMouseEnter()
    RadzenComponent.OnMouseLeave()
    RadzenComponent.OnContextMenu(MouseEventArgs)
    RadzenComponent.GetCssClass()
    RadzenComponent.GetId()
    RadzenComponent.Debounce(Func<Task>, int)
    RadzenComponent.RaiseContextMenu(MouseEventArgs)
    RadzenComponent.RaiseMouseEnter()
    RadzenComponent.RaiseMouseLeave()
    RadzenComponent.Attributes
    RadzenComponent.Element
    RadzenComponent.MouseEnter
    RadzenComponent.MouseLeave
    RadzenComponent.ContextMenu
    RadzenComponent.Culture
    RadzenComponent.DefaultCulture
    RadzenComponent.Style
    RadzenComponent.Visible
    RadzenComponent.UniqueID
    RadzenComponent.JSRuntime
    RadzenComponent.IsJSRuntimeAvailable
    RadzenComponent.Reference
    RadzenComponent.CurrentStyle
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.StateHasChanged()
    ComponentBase.ShouldRender()
    ComponentBase.OnAfterRender(bool)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.DispatchExceptionAsync(Exception)
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Radzen.Blazor
    Assembly: Radzen.Blazor.dll
    Syntax
    public class RadzenDatePicker<TValue> : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IRadzenFormComponent
    Type Parameters
    Name Description
    TValue

    The type of the t value.

    Examples
    <RadzenDatePicker @bind-Value=@someValue TValue="DateTime" Change=@(args => Console.WriteLine($"Selected date: {args}")) />

    Constructors

    RadzenDatePicker()

    Initializes a new instance of the RadzenDatePicker<TValue> class.

    Declaration
    public RadzenDatePicker()

    Fields

    input

    Gets input reference.

    Declaration
    protected ElementReference input
    Field Value
    Type Description
    ElementReference

    Properties

    AllowClear

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

    Declaration
    [Parameter]
    public bool AllowClear { get; set; }
    Property Value
    Type Description
    bool

    true if value can be cleared; otherwise, false.

    AllowInput

    Gets or sets a value indicating whether input is allowed.

    Declaration
    [Parameter]
    public bool AllowInput { get; set; }
    Property Value
    Type Description
    bool

    true if input is allowed; otherwise, false.

    ButtonClass

    Gets or sets the button CSS class.

    Declaration
    [Parameter]
    public string ButtonClass { get; set; }
    Property Value
    Type Description
    string

    The button CSS class.

    CalendarWeekTitle

    Gets or sets the previous month aria label text.

    Declaration
    [Parameter]
    public string CalendarWeekTitle { get; set; }
    Property Value
    Type Description
    string

    The previous month aria label text.

    Change

    Gets or sets the change callback.

    Declaration
    [Parameter]
    public EventCallback<DateTime?> Change { get; set; }
    Property Value
    Type Description
    EventCallback<DateTime?>

    The change callback.

    CurrentDateChanged

    Gets or set the current date changed callback.

    Declaration
    [Parameter]
    public EventCallback<DateTime> CurrentDateChanged { get; set; }
    Property Value
    Type Description
    EventCallback<DateTime>

    CurrentPlaceholder

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

    Declaration
    protected string CurrentPlaceholder { get; }
    Property Value
    Type Description
    string

    DateFormat

    Gets or sets the date format.

    Declaration
    [Parameter]
    public string DateFormat { get; set; }
    Property Value
    Type Description
    string

    The date format.

    DateRender

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

    Declaration
    [Parameter]
    public Action<DateRenderEventArgs> DateRender { get; set; }
    Property Value
    Type Description
    Action<DateRenderEventArgs>

    The date render callback.

    Disabled

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

    Declaration
    [Parameter]
    public bool Disabled { get; set; }
    Property Value
    Type Description
    bool

    true if disabled; otherwise, false.

    EditContext

    Gets or sets the edit context.

    Declaration
    [CascadingParameter]
    public EditContext EditContext { get; set; }
    Property Value
    Type Description
    EditContext

    The edit context.

    FieldIdentifier

    Gets the field identifier.

    Declaration
    [Parameter]
    public FieldIdentifier FieldIdentifier { get; set; }
    Property Value
    Type Description
    FieldIdentifier

    The field identifier.

    FooterTemplate

    Gets or sets the footer template.

    Declaration
    [Parameter]
    public RenderFragment FooterTemplate { get; set; }
    Property Value
    Type Description
    RenderFragment

    The footer template.

    Form

    Gets or sets the form.

    Declaration
    [CascadingParameter]
    public IRadzenForm Form { get; set; }
    Property Value
    Type Description
    IRadzenForm

    The form.

    FormFieldContext

    Gets or sets the FormFieldContext of the component

    Declaration
    [CascadingParameter]
    public IFormFieldContext FormFieldContext { get; set; }
    Property Value
    Type Description
    IFormFieldContext

    FormattedValue

    Gets the formatted value.

    Declaration
    public string FormattedValue { get; }
    Property Value
    Type Description
    string

    The formatted value.

    HasValue

    Gets a value indicating whether this instance has value.

    Declaration
    public bool HasValue { get; }
    Property Value
    Type Description
    bool

    true if this instance has value; otherwise, false.

    HourFormat

    Gets or sets the hour format.

    Declaration
    [Parameter]
    public string HourFormat { get; set; }
    Property Value
    Type Description
    string

    The hour format.

    HoursStep

    Gets or sets the hours step.

    Declaration
    [Parameter]
    public string HoursStep { get; set; }
    Property Value
    Type Description
    string

    The hours step.

    InitialViewDate

    Gets or sets the Initial Date/Month View.

    Declaration
    [Parameter]
    public DateTime? InitialViewDate { get; set; }
    Property Value
    Type Description
    DateTime?

    The Initial Date/Month View.

    Inline

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

    Declaration
    [Parameter]
    public bool Inline { get; set; }
    Property Value
    Type Description
    bool

    true if inline; otherwise, false.

    InputAttributes

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

    Declaration
    [Parameter]
    public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, object>

    The attributes.

    InputClass

    Gets or sets the input CSS class.

    Declaration
    [Parameter]
    public string InputClass { get; set; }
    Property Value
    Type Description
    string

    The input CSS class.

    IsBound

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

    Declaration
    public bool IsBound { get; }
    Property Value
    Type Description
    bool

    true if this instance is bound; otherwise, false.

    Kind

    Gets or sets the kind of DateTime bind to control

    Declaration
    [Parameter]
    public DateTimeKind Kind { get; set; }
    Property Value
    Type Description
    DateTimeKind

    Max

    Gets or sets the Maximum Selectable Date.

    Declaration
    [Parameter]
    public DateTime? Max { get; set; }
    Property Value
    Type Description
    DateTime?

    The Maximum Selectable Date.

    Min

    Gets or sets the Minimum Selectable Date.

    Declaration
    [Parameter]
    public DateTime? Min { get; set; }
    Property Value
    Type Description
    DateTime?

    The Minimum Selectable Date.

    MinutesStep

    Gets or sets the minutes step.

    Declaration
    [Parameter]
    public string MinutesStep { get; set; }
    Property Value
    Type Description
    string

    The minutes step.

    Name

    Gets or sets the name of the form component.

    Declaration
    [Parameter]
    public string Name { get; set; }
    Property Value
    Type Description
    string

    The name.

    NextMonthAriaLabel

    Gets or sets the next month aria label text.

    Declaration
    [Parameter]
    public string NextMonthAriaLabel { get; set; }
    Property Value
    Type Description
    string

    The next month aria label text.

    OkAriaLabel

    Gets or sets the OK button aria label text.

    Declaration
    [Parameter]
    public string OkAriaLabel { get; set; }
    Property Value
    Type Description
    string

    The OK button aria label text.

    PadHours

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

    Declaration
    [Parameter]
    public bool PadHours { get; set; }
    Property Value
    Type Description
    bool

    true if hour component is padded; otherwise, false.

    PadMinutes

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

    Declaration
    [Parameter]
    public bool PadMinutes { get; set; }
    Property Value
    Type Description
    bool

    true if hour component is padded; otherwise, false.

    PadSeconds

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

    Declaration
    [Parameter]
    public bool PadSeconds { get; set; }
    Property Value
    Type Description
    bool

    true if hour component is padded; otherwise, false.

    ParseInput

    Parse the input using an function outside the Radzen-library

    Declaration
    [Parameter]
    public Func<string, DateTime?> ParseInput { get; set; }
    Property Value
    Type Description
    Func<string, DateTime?>

    Placeholder

    Gets or sets the input placeholder.

    Declaration
    [Parameter]
    public string Placeholder { get; set; }
    Property Value
    Type Description
    string

    The input placeholder.

    PopupRenderMode

    Gets or sets the render mode.

    Declaration
    [Parameter]
    public PopupRenderMode PopupRenderMode { get; set; }
    Property Value
    Type Description
    PopupRenderMode

    The render mode.

    PrevMonthAriaLabel

    Gets or sets the previous month aria label text.

    Declaration
    [Parameter]
    public string PrevMonthAriaLabel { get; set; }
    Property Value
    Type Description
    string

    The previous month aria label text.

    ReadOnly

    Gets or sets a value indicating whether read only.

    Declaration
    [Parameter]
    public bool ReadOnly { get; set; }
    Property Value
    Type Description
    bool

    true if read only; otherwise, false.

    SecondsStep

    Gets or sets the seconds step.

    Declaration
    [Parameter]
    public string SecondsStep { get; set; }
    Property Value
    Type Description
    string

    The seconds step.

    ShowButton

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

    Declaration
    [Parameter]
    public bool ShowButton { get; set; }
    Property Value
    Type Description
    bool

    true if need show button open datepicker popup; false if need hide button, click for input field open datepicker popup.

    ShowCalendarWeek

    Gets or sets a value indicating whether calendar week will be shown.

    Declaration
    [Parameter]
    public bool ShowCalendarWeek { get; set; }
    Property Value
    Type Description
    bool

    true if calendar week is shown; otherwise, false.

    ShowDays

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

    Declaration
    [Parameter]
    public bool ShowDays { get; set; }
    Property Value
    Type Description
    bool

    true if days part is shown; otherwise, false.

    ShowInput

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

    Declaration
    [Parameter]
    public bool ShowInput { get; set; }
    Property Value
    Type Description
    bool

    true to show the input box; false to hide the input box.

    ShowSeconds

    Gets or sets a value indicating whether seconds are shown.

    Declaration
    [Parameter]
    public bool ShowSeconds { get; set; }
    Property Value
    Type Description
    bool

    true if seconds are shown; otherwise, false.

    ShowTime

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

    Declaration
    [Parameter]
    public bool ShowTime { get; set; }
    Property Value
    Type Description
    bool

    true if time part is shown; otherwise, false.

    ShowTimeOkButton

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

    Declaration
    [Parameter]
    public bool ShowTimeOkButton { get; set; }
    Property Value
    Type Description
    bool

    true if time ok button is shown; otherwise, false.

    TabIndex

    Gets or sets the tab index.

    Declaration
    [Parameter]
    public int TabIndex { get; set; }
    Property Value
    Type Description
    int

    The tab index.

    TimeOnly

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

    Declaration
    [Parameter]
    public bool TimeOnly { get; set; }
    Property Value
    Type Description
    bool

    true if time only can be set; otherwise, false.

    ToggleAmPmAriaLabel

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

    Declaration
    [Parameter]
    public string ToggleAmPmAriaLabel { get; set; }
    Property Value
    Type Description
    string

    The toggle Am/Pm aria label text.

    ToggleAriaLabel

    Gets or sets the toggle popup aria label text.

    Declaration
    [Parameter]
    public string ToggleAriaLabel { get; set; }
    Property Value
    Type Description
    string

    The toggle popup aria label text.

    Value

    Gets or sets the value.

    Declaration
    [Parameter]
    public object Value { get; set; }
    Property Value
    Type Description
    object

    The value.

    ValueChanged

    Gets or sets the value changed callback.

    Declaration
    [Parameter]
    public EventCallback<TValue> ValueChanged { get; set; }
    Property Value
    Type Description
    EventCallback<TValue>

    The value changed callback.

    ValueExpression

    Gets or sets the value expression.

    Declaration
    [Parameter]
    public Expression<Func<TValue>> ValueExpression { get; set; }
    Property Value
    Type Description
    Expression<Func<TValue>>

    The value expression.

    YearFormat

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

    Declaration
    [Parameter]
    public string YearFormat { get; set; }
    Property Value
    Type Description
    string

    YearFormatter

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

    Declaration
    [Parameter]
    public Func<int, string> YearFormatter { get; set; }
    Property Value
    Type Description
    Func<int, string>

    YearRange

    Gets or sets the year range.

    Declaration
    [Parameter]
    public string YearRange { get; set; }
    Property Value
    Type Description
    string

    The year range.

    Methods

    BuildRenderTree(RenderTreeBuilder)

    RadzenDatePicker component.

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

    Close()

    Closes this instance popup.

    Declaration
    public void Close()

    Dispose()

    Detaches event handlers and disposes Reference.

    Declaration
    public override void Dispose()
    Overrides
    RadzenComponent.Dispose()

    FocusAsync()

    Sets the focus.

    Declaration
    public ValueTask FocusAsync()
    Returns
    Type Description
    ValueTask

    GetComponentCssClass()

    Gets the component CSS class.

    Declaration
    protected override string GetComponentCssClass()
    Returns
    Type Description
    string
    Overrides
    RadzenComponent.GetComponentCssClass()

    GetValue()

    Gets the value.

    Declaration
    public object GetValue()
    Returns
    Type Description
    object

    System.Object.

    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
    RadzenComponent.OnAfterRenderAsync(bool)

    OnInitialized()

    Called by the Blazor runtime.

    Declaration
    protected override void OnInitialized()
    Overrides
    RadzenComponent.OnInitialized()

    ParseDate()

    Parses the date.

    Declaration
    protected Task ParseDate()
    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
    Overrides
    RadzenComponent.SetParametersAsync(ParameterView)

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    IRadzenFormComponent

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2025 Radzen. Source Code licensed under MIT