New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Kendo UI DatePicker TagHelper DatePickerTagHelper class.

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("kendo-datepicker")]
[HtmlTargetElement("datepicker-editor", ParentTag = "form-item")]
[HtmlTargetElement("datepicker-editor", ParentTag = "property-grid-item")]
[RestrictChildren("messages", new string[] { "popup", "month-template", "label", "animation", "aria-template" })]
[OutputElementHint("input")]
public class DatePickerTagHelper : CalendarBaseTagHelper, ITagHelper, ITagHelperComponent, IKendoFormEditor, ITemplateComponent

Inheritance: objectTagHelperTagHelperBaseCalendarBaseTagHelperDatePickerTagHelper

Implements: IKendoFormEditorITagHelperITagHelperComponentITemplateComponent

Inherited Members CalendarBaseTagHelper.MonthCalendarBaseTagHelper.DisableDatesHandlerTagHelperBase.MinimumValidatorTagHelperBase.MaximumValidatorTagHelperBase.Init(TagHelperContext)TagHelperBase.Process(TagHelperContext, TagHelperOutput)TagHelperBase.GetInitializator()TagHelperBase.GenerateId(TagHelperOutput)TagHelperBase.CreateHandler(string)TagHelperBase.GetRangeValidationParameter<TValue>(ModelExplorer, string)TagHelperBase.ExtractEditFormat(string)TagHelperBase.ToDictionaryHandler(IDictionary<string, string>)TagHelperBase.AddSelfToTemplate(TagHelperContext)TagHelperBase.ViewContextTagHelperBase.GeneratorTagHelperBase.InitializerTagHelperBase.WriterTagHelperBase.ScriptAttributesTagHelperBase.NameTagHelperBase.IdTagHelperBase.SelectorTagHelperBase.IdPrefixTagHelperBase.IsInClientTemplateTagHelperBase.DeferredTagHelperBase.AsModuleTagHelper.Orderobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Example:

csharp
@addTagHelper *, Kendo.Mvc

<kendo-datepicker name="datepicker" value="DateTime.Today">
</kendo-datepicker>

Constructors

Initializes a new instance of the DatePickerTagHelper class.

C#
public DatePickerTagHelper(IKendoHtmlGenerator generator)
Parameters:generatorIKendoHtmlGenerator

Properties

Specifies the adaptive rendering of the component.

C#
public AdaptiveMode? AdaptiveMode { get; set; }

Allows customization of the subtitle's text in the adaptive view of the component.

C#
public string AdaptiveSubtitle { get; set; }

Allows customization of the title's text in the adaptive view of the component.

C#
public string AdaptiveTitle { get; set; }

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..

C#
[HtmlAttributeName("ariatemplate")]
public string ARIATemplate { get; set; }

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.. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string ARIATemplateHandler { get; set; }

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.. This option expects the ID of the script element that contains the template.

C#
[HtmlAttributeName("ariatemplate-id")]
public string ARIATemplateId { get; set; }

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.. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent ARIATemplateView { get; set; }

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.

C#
public bool? AutoAdjust { get; set; }

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.

C#
public bool? AutoCorrectParts { get; set; }

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.

C#
public bool? AutoFill { get; set; }

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..

C#
public string ComponentType { get; set; }

Specifies the culture info used by the widget.

C#
public string Culture { get; set; }

Specifies if the DatePicker will use DateInput for editing value

C#
public bool? DateInput { get; set; }

Specifies a list of dates, which will be passed to the month content.

C#
public DateTime[] Dates { get; set; }

Specifies the navigation depth.

C#
public CalendarView? Depth { get; set; }

An array or function that will be used to determine which dates to be disabled for selection by the widget.

C#
public DateTime[] DisableDates { get; set; }

Sets a value controlling how the color is applied.

C#
public FillMode? FillMode { get; set; }

The template which renders the footer of the calendar. If false, the footer will not be rendered.

C#
public string Footer { get; set; }

The template which renders the footer of the calendar. If false, the footer will not be rendered.

C#
public string FooterHandler { get; set; }

An expression to be evaluated against the current model.

C#
public ModelExpression For { get; set; }

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.

C#
public string Format { get; set; }

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.

C#
public string InputMode { get; set; }

IsNested member.

C#
[HtmlAttributeNotBound]
public bool IsNested { get; set; }

Implements: IKendoFormEditor.IsNested

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.

C#
[HtmlAttributeName("label")]
public string LabelValue { get; set; }

Specifies the maximum date, which the calendar can show.

C#
public DateTime? Max { get; set; }

Specifies the minimum date that the calendar can show.

C#
public DateTime? Min { get; set; }

The name of the JavaScript function that will handle the change event. Fires when the selected date is changed

C#
public string OnChange { get; set; }

The name of the JavaScript function that will handle the close event. Fires when the calendar is closed

C#
public string OnClose { get; set; }

The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the DatePicker is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public string OnKendoKeydown { get; set; }

The name of the JavaScript function that will handle the open event. Fires when the calendar is opened

C#
public string OnOpen { get; set; }

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.

C#
public string[] ParseFormats { get; set; }

If set to true, the widget will be readonly and will not allow user input. The widget is not readonly be default and allow user input.

C#
public bool? Readonly { get; set; }

Sets a value controlling the border radius.

C#
public Rounded? Rounded { get; set; }

Sets the size of the component.

C#
public ComponentSize? Size { get; set; }

Specifies the start view of the calendar.

C#
public CalendarView? Start { get; set; }

Configures the templates for the DatePicker.

C#
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }

Implements: ITemplateComponent.Templates

Specifies the selected date.

C#
public object Value { get; set; }

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.

C#
public bool? WeekNumber { get; set; }

Methods

Gets the initialization script.

C#
protected override string GetInitializationScript()
Returns:

string

The initialization script.

Overrides: CalendarBaseTagHelper.GetInitializationScript()

C#
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters:contextTagHelperContextoutputTagHelperOutputReturns:

Task

Overrides: TagHelper.ProcessAsync(TagHelperContext, TagHelperOutput)

Serializes the defined settings.

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

Overrides: TagHelperBase.Serialize()

SerializeEvents method.

C#
protected override Dictionary<string, object> SerializeEvents()
Returns:

Dictionary<string, object>

Overrides: CalendarBaseTagHelper.SerializeEvents()

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: CalendarBaseTagHelper.SerializeSettings()

Serializes the defined templates.

C#
protected override Dictionary<string, object> SerializeTemplates()
Returns:

Dictionary<string, object>

Overrides: TagHelperBase.SerializeTemplates()

TryAddAsEditor method.

C#
public bool TryAddAsEditor(TagHelperContext context)
Parameters:contextTagHelperContextReturns:

bool

The result.

Implements: IKendoFormEditor.TryAddAsEditor(TagHelperContext)

VerifySettings method.

C#
protected override void VerifySettings()

Overrides: CalendarBaseTagHelper.VerifySettings()

Writes the HTML output.

C#
protected override void WriteHtml(TagHelperOutput output)
Parameters:outputTagHelperOutput

The TagHelper output.

Overrides: CalendarBaseTagHelper.WriteHtml(TagHelperOutput)