New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Selected Dates

The DateTimePicker allows you to render a pre-selected date and also define the minimum and maximum dates it displays.

For a complete example on how to select ranges by using the DateTimePicker, refer to the demo on range selection.

Telerik UI for ASP.NET MVC includes the DateRangePicker component that can be used for selecting date ranges.

The following example demonstrates how to render a DateTimePicker with an initially selected date and defined min and max dates. The DateTimePicker sets the value only if the entered date is within the defined range and is valid.

    @(Html.Kendo().DateTimePicker()
        .Name("dateTimePicker")
        .Value(DateTime.Now)
        .Min(new DateTime(1950, 1, 1, 10, 0, 0))
        .Max(new DateTime(2050, 1, 1, 20, 0, 0))
    )

See Also

In this article