DatePicker TagHelper Overview

The Telerik UI DatePicker TagHelper for ASP.NET Core is a server-side wrapper for the Kendo UI DatePicker widget.

The DatePicker enables the user to enter or pick a date value.

Initializing the DatePicker

The following example demonstrates how to define the DatePicker by using the DatePicker TagHelper.

  <kendo-datepicker name="datepicker1"></kendo-datepicker>

Basic Configuration

The DatePicker TagHelper configuration options are passed as attributes of the tag.


        @(Html.Kendo().DatePicker()
                .Name("monthpicker")
                .Start(CalendarView.Year)
                .Depth(CalendarView.Year)
                .Format("MMMM yyyy")
                .Value(DateTime.Now)
        )

        <kendo-datepicker name="monthpicker" start="CalendarView.Year" depth="CalendarView.Year"
            format="MMMM yyyy" value="DateTime.Now">
        </kendo-datepicker>

The ParseFormats option is of type string[] and can be assigned either by a ViewBag property or by a property of the model.

    @{
        ViewBag.ParseDates = new string[] { "MMMM yyyy", "MMMM" };
    }

    <kendo-datepicker name="datepicker" parse-formats="ViewBag.ParseDates"></kendo-datepicker>

See Also

In this article
Not finding the help you need? Improve this article