Class SfDatePicker<TValue>
The DatePicker is a graphical user interface component that allows the user to select or enter a date value.
Inheritance
System.Object
SfDatePicker<TValue>
Inherited Members
Syncfusion.Blazor.Calendars.CalendarBase<TValue>.SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView)
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BlurHandler()
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnChange
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnInput
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnPaste
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnBlur
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnFocus
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ValueExpression
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.SpinButton
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ValueTemplate
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.IsValueTemplate
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ClickStopPropagation
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.MouseDowSpinnerPrevent
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.PreventIconHandler
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.MousePreventContainer
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ContainerClass
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.RootClass
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfDatePicker<TValue> : CalendarBase<TValue>
Type Parameters
Name |
Description |
TValue |
Specifies the type of SfDatePicker.
|
Constructors
SfDatePicker()
Declaration
Fields
DATE_ICON
Declaration
protected const string DATE_ICON = "e-date-icon e-icons"
Field Value
Type |
Description |
System.String |
|
Properties
AllowEdit
Specifies a boolean value whether the DatePicker allows user to change the value via typing. When set as false, the DatePicker allows user to change the value via picker only.
Declaration
public bool AllowEdit { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
BaseFloatLabelType
Declaration
protected override FloatLabelType BaseFloatLabelType { get; set; }
Property Value
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseFloatLabelType
BaseHtmlAttributes
Declaration
protected override Dictionary<string, object> BaseHtmlAttributes { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Object> |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseHtmlAttributes
Declaration
protected override Dictionary<string, object> BaseInputAttributes { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Object> |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseInputAttributes
Declaration
protected override bool BaseIsReadOnlyInput { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseIsReadOnlyInput
BasePlaceholder
Declaration
protected override string BasePlaceholder { get; set; }
Property Value
Type |
Description |
System.String |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BasePlaceholder
BaseReadonly
Declaration
protected override bool BaseReadonly { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseReadonly
Declaration
protected override bool BaseShowClearButton { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseShowClearButton
BaseTabIndex
Declaration
protected override int BaseTabIndex { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseTabIndex
BaseWidth
Declaration
protected override string BaseWidth { get; set; }
Property Value
Type |
Description |
System.String |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseWidth
FloatLabelType
Specifies the floating label behavior of the DatePicker that the placeholder text floats above the DatePicker based on the following values.
Possible values are:
- NeverNever floats the label in the DatePicker when the placeholder is available.
- AlwaysThe floating label always floats above the DatePicker.
- AutoThe floating label floats above the DatePicker after focusing it or when enters the value in it.
Declaration
public FloatLabelType FloatLabelType { get; set; }
Property Value
Specifies the format of the value that to be displayed in component.
By default, the format is based on the culture.
You can set the format to "format:'dd/MM/yyyy hh:mm'".
Declaration
public string Format { get; set; }
Property Value
Type |
Description |
System.String |
|
HtmlAttributes
You can add the additional html attributes such as styles, class, and more to the root element.
If you configured both property and equivalent html attributes, then the component considers the property value.
Declaration
public Dictionary<string, object> HtmlAttributes { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Object> |
|
You can add the additional input attributes such as disabled, value, and more to the root element.
If you configured both property and equivalent input attribute, then the component considers the property value.
Declaration
public Dictionary<string, object> InputAttributes { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Object> |
|
Placeholder
Specifies the text that is shown as a hint or placeholder until the user focuses or enter a value in DatePicker. The property is depending on the FloatLabelType property.
Declaration
public string Placeholder { get; set; }
Property Value
Type |
Description |
System.String |
|
Readonly
Specifies the boolean value whether the DatePicker allows the user to change the text.
Declaration
public bool Readonly { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Specifies a boolean value that indicates whether the clear button is displayed in DatePicker.
Declaration
public bool ShowClearButton { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
StrictMode
Specifies the component to act as strict. So that, it allows to enter only a valid date value within a specified range or else it will resets to previous value.
By default, StrictMode is in false. It allows invalid or out-of-range date value with highlighted error class.
Declaration
public bool StrictMode { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
TabIndex
Specifies the tab order of the DatePicker component.
Declaration
public int TabIndex { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
TimePart
Declaration
protected DateTime TimePart { get; set; }
Property Value
Type |
Description |
System.DateTime |
|
Width
Specifies the width of the DatePicker component.
Declaration
public string Width { get; set; }
Property Value
Type |
Description |
System.String |
|
ZIndex
Specifies the z-index value of the DatePicker popup element.
Declaration
public int ZIndex { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder |
__builder |
|
Method to trigger the client-side actions once the popup is displayed when date icon is clicked.
Declaration
protected virtual Task ClientPopupRender()
Returns
Type |
Description |
System.Threading.Tasks.Task |
The System.Threading.Tasks.Task.
|
CurrentView()
Gets the current view of the calendar.
Declaration
public string CurrentView()
Returns
Type |
Description |
System.String |
The System.String.
|
FocusAsync()
Sets focus to the DatePicker component for interaction.
Declaration
Returns
Type |
Description |
System.Threading.Tasks.Task |
The System.Threading.Tasks.Task.
|
FocusOutAsync()
Remove focus from the DatePicker component, if the component is in focus state.
Declaration
public Task FocusOutAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
The System.Threading.Tasks.Task.
|
Declaration
protected override TValue FormatValue(string genericValue)
Parameters
Type |
Name |
Description |
System.String |
genericValue |
|
Returns
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.FormatValue(System.String)
Declaration
protected override string FormatValueAsString(TValue formatValue)
Parameters
Type |
Name |
Description |
TValue |
formatValue |
|
Returns
Type |
Description |
System.String |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.FormatValueAsString(TValue)
GetPersistDataAsync()
Gets the properties to be maintained in the persisted state.
Declaration
public Task<string> GetPersistDataAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task<System.String> |
The System.Threading.Tasks.Task<>.
|
Declaration
public Task HidePopupAsync(EventArgs args = null)
Parameters
Type |
Name |
Description |
System.EventArgs |
args |
Specifies the event arguments.
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
The System.Threading.Tasks.Task.
|
Declaration
protected override Task InputHandler(ChangeEventArgs args)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.ChangeEventArgs |
args |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.InputHandler(Microsoft.AspNetCore.Components.ChangeEventArgs)
InvokeClearBtnEvent(EventArgs)
Declaration
protected Task InvokeClearBtnEvent(EventArgs args)
Parameters
Type |
Name |
Description |
System.EventArgs |
args |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
NavigateAsync(CalendarView, TValue)
To navigate to the month or year or decade view of the calendar.
Declaration
public Task NavigateAsync(CalendarView view, TValue date)
Parameters
Type |
Name |
Description |
CalendarView |
view |
Specifies the view of the calendar.
|
TValue |
date |
Specifies the focused date in a view.
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
The System.Threading.Tasks.Task.
|
Opens the popup to show the calendar.
Declaration
public Task ShowPopupAsync(EventArgs args = null)
Parameters
Type |
Name |
Description |
System.EventArgs |
args |
Specifies the event arguments.
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
The System.Threading.Tasks.Task.
|
Task used to update the popup state.
Declaration
protected virtual void UpdateDateTimePopupState(bool isOpen)
Parameters
Type |
Name |
Description |
System.Boolean |
isOpen |
true if the popup is in opened state, otherwise false.
|
UpdateValidateClass()
Method which updates the valid class based on the value .
Declaration
protected void UpdateValidateClass()