DatePickerBuilder
Properties
WriteAction - Func
Methods
Animation(System.Boolean)
Use to enable or disable animation of the popup element.
Parameters
enable - System.Boolean
The boolean value.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.Animation(false) //toggle effect
)
Animation(System.Action)
Configures the animation effects of the widget.
Parameters
animationAction - System.Action<PopupAnimationBuilder>
The action which configures the animation effects.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.Animation(animation =>
{
animation.Open(open =>
{
open.SlideIn(SlideDirection.Down);
})
})
)
DisableDates(System.Collections.Generic.IEnumerable)
Parameters
disableDates - System.Collections.Generic.IEnumerable<String>
DisableDates(System.DayOfWeek[])
Specifies the disabled dates in the DatePicker widget.
Parameters
days - System.DayOfWeek[]
Configures the disabled dates.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("datePicker")
.DisableDates(DayofWeek.Saturday, DayOfWeek.Sunday)
)
DisableDates(System.String)
Specifies the disabled dates in the DatePicker widget using a function handler.
Parameters
handler - System.String
Configures the disabled dates.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("datePicker")
.DisableDates("disableDates")
)
Enable(System.Boolean)
Enables or disables the picker.
Parameters
value - System.Boolean
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("datePicker")
.Enable(false)
)
Value(System.String)
Sets the value of the picker input
Parameters
date - System.String
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("datePicker")
.Value("8/1/2022")
)
Value(System.Nullable)
Sets the value of the picker input
Parameters
date - System.Nullable<DateTime>
The initial value of the picker.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("datePicker")
.Value(DateTime.Now)
)
BindTo(System.Collections.Generic.List)
Specifies a list of dates, which will be passed to the month template.
Parameters
dates - System.Collections.Generic.List<DateTime>
The dates.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.BindTo(new List<DateTime> { DateTime.Now })
)
FooterId(System.String)
FooterId to be used for rendering the footer of the Calendar.
Parameters
id - System.String
The footer template's id.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.FooterId("widgetFooterId")
)
Footer(System.Boolean)
Enables/disables footer of the calendar popup.
Parameters
footer - System.Boolean
If set to false, disables the footer.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.Footer(false)
)
MonthTemplate(Kendo.Mvc.UI.Fluent.TemplateBuilder)
Templates for the cells rendered in the "month" view.
Parameters
template - TemplateBuilder<TModel>
The template that will be used for the content of the cell values.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.MonthTemplate(Html.Kendo().Template()
.AddHtml("<div>${data.value} </div>")
)
)
MonthTemplate(System.Action)
Configures the content of cells of the Calendar.
Parameters
monthTemplateAction - System.Action<MonthTemplateBuilder>
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.MonthTemplate(month => month.Content("#= data.value #"))
)
MonthTemplateId(System.String)
MonthTemplateId to be used for rendering the cells of the Calendar.
Parameters
id - System.String
The month template's id.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.MonthTemplateId("widgetMonthTemplateId")
)
MonthTemplateView(Microsoft.AspNetCore.Html.IHtmlContent)
MonthTemplateId to be used for rendering the cells of the Calendar.
Parameters
templateView - Microsoft.AspNetCore.Html.IHtmlContent
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@( Html.Kendo().DatePicker()
.Name("DatePicker")
.MonthTemplateView(Html.Partial("WidgetMonthTemplate"))
)
MonthTemplateHandler(System.String)
Parameters
templateHandler - System.String
MonthTemplate(System.String)
Templates for the cells rendered in the "month" view.
Parameters
content - System.String
The month template's content.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.MonthTemplate("#= data.value #")
)
Min(System.String)
Sets the minimal date, which can be selected in DatePicker.
Parameters
date - System.String
The minimal date of the picker.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.Min("01/02/2010")
)
Max(System.String)
Sets the maximal date, which can be selected in DatePicker.
Parameters
date - System.String
The maximal date of the picker.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.Max("01/02/2022")
)
Value(System.DateOnly)
Specifies the selected date.
Parameters
value - System.DateOnly
The value for Value
RETURNS
A DatePickerBuilder instance for method chaining.
Value(System.Nullable)
Sets the value of the picker input
Parameters
value - System.Nullable<DateOnly>
The initial value of the picker.
RETURNS
A DatePickerBuilder instance for method chaining.
Example
@(Html.Kendo().DatePicker()
.Name("datePicker")
.Value(DateTime.Now)
)
AdaptiveTitle(System.String)
Allows customization of the title's text in the adaptive view of the component.
Parameters
value - System.String
The value for AdaptiveTitle
RETURNS
Returns the current DatePickerBuilder instance.
AdaptiveSubtitle(System.String)
Allows customization of the subtitle's text in the adaptive view of the component.
Parameters
value - System.String
The value for AdaptiveSubtitle
RETURNS
Returns the current DatePickerBuilder instance.
ARIATemplate(System.String)
Specifies a template used to populate the value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value..
Parameters
value - System.String
The value for ARIATemplate
RETURNS
Returns the current DatePickerBuilder instance.
ARIATemplateId(System.String)
Specifies a template used to populate the value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value..
Parameters
templateId - System.String
The ID of the template element for ARIATemplate
RETURNS
Returns the current DatePickerBuilder instance.
ARIATemplateView(Microsoft.AspNetCore.Html.IHtmlContent)
Specifies a template used to populate the value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value..
Parameters
templateView - Microsoft.AspNetCore.Html.IHtmlContent
The view that contains the template for ARIATemplate
RETURNS
Returns the current DatePickerBuilder instance.
ARIATemplateHandler(System.String)
Specifies a template used to populate the value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value..
Parameters
templateHandler - System.String
The handler that returs the template for ARIATemplate
RETURNS
Returns the current DatePickerBuilder instance.
ARIATemplate(Kendo.Mvc.UI.Fluent.TemplateBuilder)
Specifies a template used to populate the value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value..
Parameters
template - TemplateBuilder<TModel>
A Template component that configures the ariatemplate.
RETURNS
Returns the current DatePickerBuilder instance.
AutoAdjust(System.Boolean)
If this property is enabled and you have configured min and/or max values, and the user enters a value that falls out of that range, the value will automatically be set to either the minimum or maximum allowed value. This property has effect only when the dateInput of the component is enabled.
Parameters
value - System.Boolean
The value for AutoAdjust
RETURNS
Returns the current DatePickerBuilder instance.
AutoCorrectParts(System.Boolean)
Sets a value that indicates whether to automatically correct the segment when out of range. In order to work, dateInput prop should be set to true.
Parameters
value - System.Boolean
The value for AutoCorrectParts
RETURNS
Returns the current DatePickerBuilder instance.
AutoFill(System.Boolean)
When enabled, the DatePicker will autofill the rest of the date to the current date when the component loses focus. For example, entering only the date, month or year portion of the date and blurring the component, the missing sections will be automatically completed. Requires a DateInput for editing the value.
Parameters
value - System.Boolean
The value for AutoFill
RETURNS
Returns the current DatePickerBuilder instance.
AutoFill()
When enabled, the DatePicker will autofill the rest of the date to the current date when the component loses focus. For example, entering only the date, month or year portion of the date and blurring the component, the missing sections will be automatically completed. Requires a DateInput for editing the value.
RETURNS
Returns the current DatePickerBuilder instance.
ComponentType(System.String)
Specifies the component type of the widget. "classic" - Uses the standard rendering of the widget. or "modern" - Uses new rendering with a fresh and modern look and feel..
Parameters
value - System.String
The value for ComponentType
RETURNS
Returns the current DatePickerBuilder instance.
Culture(System.String)
Specifies the culture info used by the widget.
Parameters
value - System.String
The value for Culture
RETURNS
Returns the current DatePickerBuilder instance.
DateInput(System.Boolean)
Specifies if the DatePicker will use DateInput for editing value
Parameters
value - System.Boolean
The value for DateInput
RETURNS
Returns the current DatePickerBuilder instance.
DateInput()
Specifies if the DatePicker will use DateInput for editing value
RETURNS
Returns the current DatePickerBuilder instance.
Dates(System.DateTime[])
Specifies a list of dates, which will be passed to the month content.
Parameters
value - System.DateTime[]
The value for Dates
RETURNS
Returns the current DatePickerBuilder instance.
Footer(System.String)
The template which renders the footer of the calendar. If false, the footer will not be rendered.
Parameters
value - System.String
The value for Footer
RETURNS
Returns the current DatePickerBuilder instance.
Format(System.String)
Specifies the format, which is used to format the value of the DatePicker displayed in the input. The format also will be used to parse the input.For more information on date and time formats please refer to Date Formatting.
Parameters
value - System.String
The value for Format
RETURNS
Returns the current DatePickerBuilder instance.
InputMode(System.String)
Specifies the inputmode attribute of the inner <input /> element. It is used to specify the type of on-screen keyboard that should be displayed when the user focuses the input.
Parameters
value - System.String
The value for InputMode
RETURNS
Returns the current DatePickerBuilder instance.
Label(System.Action)
Adds a label before the datepicker. If the datepicker has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.
Parameters
configurator - System.Action<DatePickerLabelSettingsBuilder>
The configurator for the label setting.
RETURNS
Returns the current instance of DatePickerBuilder .
Max(System.DateTime)
Specifies the maximum date, which the calendar can show.
Parameters
value - System.DateTime
The value for Max
RETURNS
Returns the current DatePickerBuilder instance.
Messages(System.Action)
Allows localization of the strings that are used in the widget.
Parameters
configurator - System.Action<DatePickerMessagesSettingsBuilder>
The configurator for the messages setting.
RETURNS
Returns the current instance of DatePickerBuilder .
Min(System.DateTime)
Specifies the minimum date that the calendar can show.
Parameters
value - System.DateTime
The value for Min
RETURNS
Returns the current DatePickerBuilder instance.
Popup(System.Action)
The options that will be used for the popup initialization. For more details about the available options refer to Popup documentation.
Parameters
configurator - System.Action<DatePickerPopupSettingsBuilder>
The configurator for the popup setting.
RETURNS
Returns the current instance of DatePickerBuilder .
WeekNumber(System.Boolean)
If set to true a week of the year will be shown on the left side of the calendar. It is possible to define a template in order to customize what will be displayed.
Parameters
value - System.Boolean
The value for WeekNumber
RETURNS
Returns the current DatePickerBuilder instance.
WeekNumber()
If set to true a week of the year will be shown on the left side of the calendar. It is possible to define a template in order to customize what will be displayed.
RETURNS
Returns the current DatePickerBuilder instance.
ParseFormats(System.String[])
Specifies a list of date formats used to parse the value set with value() method or by direct user input. If not set the value of the format will be used. Note that the format option is always used during parsing.
Parameters
value - System.String[]
The value for ParseFormats
RETURNS
Returns the current DatePickerBuilder instance.
Value(System.DateTime)
Specifies the selected date.
Parameters
value - System.DateTime
The value for Value
RETURNS
Returns the current DatePickerBuilder instance.
Start(Kendo.Mvc.UI.CalendarView)
Parameters
value - CalendarView
The value for Start
RETURNS
Returns the current DatePickerBuilder instance.
Depth(Kendo.Mvc.UI.CalendarView)
Specifies the navigation depth.
Parameters
value - CalendarView
The value for Depth
RETURNS
Returns the current DatePickerBuilder instance.
Size(Kendo.Mvc.UI.ComponentSize)
Sets the size of the component.
Parameters
value - ComponentSize
The value for Size
RETURNS
Returns the current DatePickerBuilder instance.
Rounded(Kendo.Mvc.UI.Rounded)
Sets a value controlling the border radius.
Parameters
value - Rounded
The value for Rounded
RETURNS
Returns the current DatePickerBuilder instance.
FillMode(Kendo.Mvc.UI.FillMode)
Sets a value controlling how the color is applied.
Parameters
value - FillMode
The value for FillMode
RETURNS
Returns the current DatePickerBuilder instance.
AdaptiveMode(Kendo.Mvc.UI.AdaptiveMode)
Specifies the adaptive rendering of the component.
Parameters
value - AdaptiveMode
The value for AdaptiveMode
RETURNS
Returns the current DatePickerBuilder instance.
Events(System.Action)
Configures the client-side events.
Parameters
configurator - System.Action<DatePickerEventBuilder>
The client events action.
RETURNS
Returns the current DatePickerBuilder instance.
Example
@(Html.Kendo().DatePicker()
.Name("DatePicker")
.Events(events => events
.Change("onChange")
)
)
UseMvvmInitialization(System.Boolean)
Specifies if the component should be initialized through MVVM on the client.
Parameters
value - System.Boolean
The value.
RETURNS
Returns the current instance.
UseMvvmInitialization()
Specifies if the component should be initialized through MVVM on the client.
RETURNS
Returns the current instance.
ToComponent()
Returns the internal view component.
RETURNS
The instance that represents the component.
Expression(System.String)
Sets the name of the component.
Parameters
modelExpression - System.String
RETURNS
Returns the current instance.
Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)
Sets the name of the component.
Parameters
modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer
RETURNS
Returns the current instance.
Name(System.String)
Sets the name of the component.
Parameters
componentName - System.String
The name.
RETURNS
Returns the current instance.
Deferred(System.Boolean)
Suppress initialization script rendering. Note that this options should be used in conjunction with
Parameters
deferred - System.Boolean
RETURNS
Returns a DeferredWidgetBuilder instance.
HtmlAttributes(System.Object)
Sets the HTML attributes.
Parameters
attributes - System.Object
The HTML attributes.
RETURNS
Returns the current instance.
HtmlAttributes(System.Collections.Generic.IDictionary)
Sets the HTML attributes.
Parameters
attributes - System.Collections.Generic.IDictionary<String,Object>
The HTML attributes.
RETURNS
Returns the current instance.
ScriptAttributes(System.Object,System.Boolean)
Sets the JavaScript attributes to the initialization script.
Parameters
attributes - System.Object
The JavaScript attributes.
overrideAttributes - System.Boolean
Argument which determines whether attributes should be overriden.
RETURNS
Returns the current instance.
ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)
Sets the JavaScript attributes to the initialization script.
Parameters
attributes - System.Collections.Generic.IDictionary<String,Object>
The JavaScript attributes.
overrideAttributes - System.Boolean
Argument which determines whether attributes should be overriden.
RETURNS
Returns the current instance.
Render()
Renders the component in place.
ToHtmlString()
Returns the HTML representation of the component.
WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)
Parameters
writer - System.IO.TextWriter
encoder - System.Text.Encodings.Web.HtmlEncoder
ToClientTemplate()
Returns the client template for the component.
AsModule(System.Boolean)
Specifies whether the initialization script of the component will be rendered as a JavaScript module.
Parameters
value - System.Boolean
RETURNS
Returns the current instance.