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
Syncfusion.Blazor.SfBaseComponent
SfDatePicker<TValue>
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfDatePicker<TValue> : CalendarBase<TValue>, IInputBase
Type Parameters
Constructors
SfDatePicker()
Declaration
Fields
ACTIVE
Declaration
protected const string ACTIVE = "e-active"
Field Value
Type |
Description |
System.String |
|
ARIA_EXPANDED
Declaration
protected const string ARIA_EXPANDED = "aria-expanded"
Field Value
Type |
Description |
System.String |
|
BODY
Declaration
protected const string BODY = "body"
Field Value
Type |
Description |
System.String |
|
DATE_PICKER
Declaration
protected const string DATE_PICKER = "e-datepicker"
Field Value
Type |
Description |
System.String |
|
Declaration
protected const string INPUT_FOCUS = "e-input-focus"
Field Value
Type |
Description |
System.String |
|
MODEL
Declaration
protected const string MODEL = "model"
Field Value
Type |
Description |
System.String |
|
MODEL_DAY
Declaration
protected const string MODEL_DAY = "e-model-day"
Field Value
Type |
Description |
System.String |
|
Declaration
protected const string MODEL_HEADER = "e-model-header"
Field Value
Type |
Description |
System.String |
|
MODEL_MONTH
Declaration
protected const string MODEL_MONTH = "e-model-month"
Field Value
Type |
Description |
System.String |
|
MODEL_YEAR
Declaration
protected const string MODEL_YEAR = "e-model-year"
Field Value
Type |
Description |
System.String |
|
Declaration
protected const string POPUP = "e-popup"
Field Value
Type |
Description |
System.String |
|
Declaration
protected const string POPUP_HOLDER = "e-datepicker e-popup-holder"
Field Value
Type |
Description |
System.String |
|
READ_ONLY
Declaration
protected const string READ_ONLY = "readonly"
Field Value
Type |
Description |
System.String |
|
TRUE
Declaration
protected const string TRUE = "true"
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 |
|
CalendarBaseInstance
Declaration
protected CalendarBaseRender<TValue> CalendarBaseInstance { get; set; }
Property Value
Type |
Description |
Syncfusion.Blazor.Calendars.Internal.CalendarBaseRender<TValue> |
|
calendarClass
Declaration
protected string calendarClass { get; set; }
Property Value
Type |
Description |
System.String |
|
changedEventArgs
Declaration
protected ChangedEventArgs<TValue> changedEventArgs { get; set; }
Property Value
CONTAINER_CLASS
Declaration
protected virtual string CONTAINER_CLASS { get; set; }
Property Value
Type |
Description |
System.String |
|
ContainerClass
Declaration
protected string ContainerClass { get; set; }
Property Value
Type |
Description |
System.String |
|
CssClass
Specifies the CSS class name that can be appended with the root element of the DatePicker. One or more custom CSS classes can be added to a DatePicker.
Declaration
public string CssClass { get; set; }
Property Value
Type |
Description |
System.String |
|
currentCulture
Declaration
protected CultureInfo currentCulture { get; set; }
Property Value
Type |
Description |
System.Globalization.CultureInfo |
|
dateIcon
Declaration
protected List<string> dateIcon { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.List<System.String> |
|
DatePickerParent
Declaration
protected dynamic DatePickerParent { get; set; }
Property Value
Type |
Description |
System.Object |
|
Enabled
Specifies a boolean value that indicates whether the DatePicker allows the user to interact with it.
Declaration
public bool Enabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
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 |
|
Declaration
protected string formattedValue { 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 the property and equivalent html attribute, 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> |
|
ID
Specifies the id of the Calendar component.
Declaration
public string ID { get; set; }
Property Value
Type |
Description |
System.String |
|
You can add the additional input attributes such as disabled, value, and more to the root element.
If you configured both the 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> |
|
Declaration
protected SfInputBase inputBaseObj { get; set; }
Property Value
Type |
Description |
Syncfusion.Blazor.Inputs.Internal.SfInputBase |
|
isCalendarRender
Declaration
protected bool isCalendarRender { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
isCalendarRendered
Declaration
protected bool isCalendarRendered { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
protected bool isDatePickerPopup { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
isDevice
Declaration
protected bool isDevice { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
isListRender
Declaration
protected bool isListRender { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
modelDay
Declaration
protected string modelDay { get; set; }
Property Value
Type |
Description |
System.String |
|
modelMonth
Declaration
protected string modelMonth { get; set; }
Property Value
Type |
Description |
System.String |
|
modelYear
Declaration
protected string modelYear { get; set; }
Property Value
Type |
Description |
System.String |
|
OnBlur
Triggers when the input loses the focus.
Declaration
public EventCallback<FocusEventArgs> OnBlur { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.Web.FocusEventArgs> |
|
OnChange
Triggers when the content of input has changed and gets focus-out.
Declaration
public EventCallback<ChangeEventArgs> OnChange { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> |
|
OnFocus
Triggers when the input gets focus.
Declaration
public EventCallback<FocusEventArgs> OnFocus { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.Web.FocusEventArgs> |
|
Triggers each time when the value of input has changed.
Declaration
public EventCallback<ChangeEventArgs> OnInput { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> |
|
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 |
|
Declaration
protected string popupContainer { get; set; }
Property Value
Type |
Description |
System.String |
|
Declaration
protected ElementReference popupElement { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.ElementReference |
|
Declaration
protected DatePickerPopupArgs popupEventArgs { get; set; }
Property Value
Type |
Description |
Syncfusion.Blazor.Calendars.Internal.DatePickerPopupArgs |
|
Declaration
protected ElementReference popupHolderEle { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.ElementReference |
|
preventIconHandler
Declaration
protected bool preventIconHandler { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
previousElementValue
Declaration
protected string previousElementValue { 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 |
|
ROOT
Declaration
protected virtual string ROOT { get; set; }
Property Value
Type |
Description |
System.String |
|
RootClass
Declaration
protected string RootClass { get; set; }
Property Value
Type |
Description |
System.String |
|
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 |
|
Declaration
protected bool ShowPopupCalendar { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
StrictMode
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 |
|
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 |
|
ChangeEvent(EventArgs)
Declaration
protected override void ChangeEvent(EventArgs args)
Parameters
Type |
Name |
Description |
System.EventArgs |
args |
|
Overrides
Syncfusion.Blazor.Calendars.CalendarBase<TValue>.ChangeEvent(System.EventArgs)
changeHandler(ChangeEventArgs)
Declaration
protected Task changeHandler(ChangeEventArgs args)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.ChangeEventArgs |
args |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
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 |
|
ConvertGeneric(DateTime)
Declaration
protected virtual TValue ConvertGeneric(DateTime dateValue)
Parameters
Type |
Name |
Description |
System.DateTime |
dateValue |
|
Returns
CurrentView()
Gets the current view of the calendar.
Declaration
public string CurrentView()
Returns
Type |
Description |
System.String |
|
dateIconHandler()
Declaration
protected Task dateIconHandler()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
focusHandler(FocusEventArgs)
Declaration
protected Task focusHandler(FocusEventArgs args)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.Web.FocusEventArgs |
args |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
FocusIn()
Sets focus to the DatePicker component for interaction.
Declaration
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
FocusOut()
Remove focus from the DatePicker component, if the component is in focus state.
Declaration
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
focusOutHandler(FocusEventArgs)
Declaration
protected Task focusOutHandler(FocusEventArgs args)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.Web.FocusEventArgs |
args |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
GetClientProperties()
Declaration
protected DatePickerClientProps<TValue> GetClientProperties()
Returns
getDefaultCulture()
Method to get the default cultureinfo
Declaration
protected CultureInfo getDefaultCulture()
Returns
Type |
Description |
System.Globalization.CultureInfo |
Cultureinfo
|
GetPersistData()
Gets the properties to be maintained in the persisted state.
Declaration
public Task<string> GetPersistData()
Returns
Type |
Description |
System.Threading.Tasks.Task<System.String> |
|
Hide(EventArgs)
Hide the calendar popup.
Specifies the event arguments
Declaration
public Task Hide(EventArgs args = null)
Parameters
Type |
Name |
Description |
System.EventArgs |
args |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Declaration
protected virtual Task HideTimePopup()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Declaration
protected Task inputHandler(ChangeEventArgs args)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.ChangeEventArgs |
args |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
InvokeBlurEvent(FocusEventArgs)
Declaration
protected virtual Task InvokeBlurEvent(FocusEventArgs args)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.Web.FocusEventArgs |
args |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
InvokeChangeEvent(EventArgs)
Declaration
protected virtual Task InvokeChangeEvent(EventArgs args = null)
Parameters
Type |
Name |
Description |
System.EventArgs |
args |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
InvokeFocusEvent(FocusEventArgs)
Declaration
protected virtual Task InvokeFocusEvent(FocusEventArgs args)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.Web.FocusEventArgs |
args |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
InvokeOpenEvent(Boolean, EventArgs)
Declaration
protected virtual Task<PopupObjectArgs> InvokeOpenEvent(bool isOpen, EventArgs args = null)
Parameters
Type |
Name |
Description |
System.Boolean |
isOpen |
|
System.EventArgs |
args |
|
Returns
isDateTimeOffsetType()
Checks whether the value type is DateTimeOffset
Declaration
protected bool isDateTimeOffsetType()
Returns
Type |
Description |
System.Boolean |
True or false based on the Type
|
isDateTimeType()
Checks whether the value type is DateTime
Declaration
protected bool isDateTimeType()
Returns
Type |
Description |
System.Boolean |
True or false based on the Type
|
NavigateTo(CalendarView, TValue)
To navigate to the month or year or decade view of the calendar.
Specifies the view of the calendar.
Specifies the focused date in a view.
Declaration
public Task NavigateTo(CalendarView view, TValue date)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
OnAfterRenderAsync(Boolean)
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type |
Name |
Description |
System.Boolean |
firstRender |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(System.Boolean)
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
Syncfusion.Blazor.SfBaseComponent.OnInitializedAsync()
Declaration
protected override Task OnParametersSetAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
selectCalendar()
Declaration
protected Task selectCalendar()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Show(EventArgs)
Opens the popup to show the calendar.
Specifies the event arguments
Declaration
public Task Show(EventArgs args = null)
Parameters
Type |
Name |
Description |
System.EventArgs |
args |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
strictModeUpdate()
Declaration
protected Task strictModeUpdate()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Declaration
protected virtual void UpdateDateTimePopupState(bool isOpen)
Parameters
Type |
Name |
Description |
System.Boolean |
isOpen |
|
updateErrorClass()
Declaration
protected void updateErrorClass()
Declaration
protected Task updateInput()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
updateValidateClass()
Declaration
protected void updateValidateClass()
updateValue(Object)
Declaration
protected Task updateValue(object dateValue)
Parameters
Type |
Name |
Description |
System.Object |
dateValue |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|