Edit this page

DatePicker Tag Helper

The DatePicker tag helper helps you configure the Kendo UI DatePicker widget in ASP.NET Core applications.

Basic Usage

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

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

Configuration

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

Example

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

    Example
        @{
            ViewBag.ParseDates = new string[] { "MMMM yyyy", "MMMM" };
        }
    
        <kendo-datepicker name="datepicker" parse-formats="ViewBag.ParseDates"></kendo-datepicker>
    

See Also