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

DateRangePickerBuilder

Methods

AllowReverse(System.Boolean)

Enables the user to select an end date that is before the start date.

Parameters

value - System.Boolean

The value that configures the allowreverse.

AutoClose(System.Boolean)

Specifies whether the calendar popup should close automatically when a range is selected.

Parameters

value - System.Boolean

The value that configures the autoclose.

ARIATemplate(System.String)

Specifies a template used to populate 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 that configures the ariatemplate.

ARIATemplateId(System.String)

Specifies a template used to populate 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 that configures the ariatemplate.

ARIATemplateView(System.Web.Mvc.MvcHtmlString)

Specifies a template used to populate 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.Web.Mvc.MvcHtmlString

The value that configures the ariatemplate.

ARIATemplateHandler(System.String)

Specifies a template used to populate 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 that configures the ariatemplate.

ARIATemplate(Kendo.Mvc.UI.TemplateBuilder)

Specifies a template used to populate 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.

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.

Parameters

value - System.Boolean

The value that configures the autoadjust.

CalendarButton(System.Boolean)

If this configuration is enabled, a calendar button will appear inside the date inputs. This is similar to the calendar button in the DatePicker component. The calendar popup will be opened only when the button is clicked. Clicking inside the input itself will have no effect.

Parameters

value - System.Boolean

The value that configures the calendarbutton.

ClearButton(System.Boolean)

If this configuration is enabled, a clear button will appear in the date inputs where a date is selected. Clicking on the clear button will remove the selected date from the input.

Parameters

value - System.Boolean

The value that configures the clearbutton.

Culture(System.String)

Specifies the culture info used by the widget.

Parameters

value - System.String

The value that configures the culture.

Dates(System.DateTime[])

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

Parameters

value - System.DateTime[]

The value that configures the dates.

Depth(System.String)

Specifies the navigation depth. The following settings are available for the depth value: "month" - Shows the days of the month. (default value); "year" - Shows the months of the year.; "decade" - Shows the years of the decade. or "century" - Shows the decades from the century..

Parameters

value - System.String

The value that configures the depth.

EndField(System.String)

Specifies the end field name for model binding.

Parameters

value - System.String

The value that configures the endfield.

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 that configures the footer.

Format(System.String)

Specifies the format, which is used to format the value of the DateRangePicker 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 that configures the format.

Max(System.DateTime)

Specifies the maximum date, which the calendar can show.

Parameters

value - System.DateTime

The value that configures the max.

Messages(System.Action)

Allows localization of the strings that are used in the widget.

Parameters

configurator - System.Action<DateRangePickerMessagesSettingsBuilder>

The action that configures the messages.

Min(System.DateTime)

Specifies the minimum date that the calendar can show.

Parameters

value - System.DateTime

The value that configures the min.

Month(System.Action)

Templates for the cells rendered in the calendar "month" view.

Parameters

configurator - System.Action<DateRangePickerMonthSettingsBuilder>

The action that configures the month.

Labels(System.Boolean)

Determines if the labels for the inputs will be visible.

Parameters

value - System.Boolean

The value that configures the labels.

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 that configures the weeknumber.

Range(System.Action)

Configures the Kendo UI DateRangePicker range settings.

Parameters

configurator - System.Action<DateRangePickerRangeSettingsBuilder>

The action that configures the range.

Start(System.String)

Specifies the start view. The following settings are available for the start value: "month" - Shows the days of the month.; "year" - Shows the months of the year.; "decade" - Shows the years of the decade. or "century" - Shows the decades from the century..

Parameters

value - System.String

The value that configures the start.

StartField(System.String)

Specifies the start field name for model binding.

Parameters

value - System.String

The value that configures the startfield.

Size(Kendo.Mvc.UI.ComponentSize)

Sets the size of the component.

Parameters

value - ComponentSize

The value that configures the size.

Rounded(Kendo.Mvc.UI.Rounded)

Sets a value controlling the border radius.

Parameters

value - Rounded

The value that configures the rounded.

FillMode(Kendo.Mvc.UI.FillMode)

Sets a value controlling how the color is applied.

Parameters

value - FillMode

The value that configures the fillmode.

AdaptiveMode(Kendo.Mvc.UI.AdaptiveMode)

Specifies the adaptive rendering of the component.

Parameters

value - AdaptiveMode

The value that configures the adaptivemode.

DisableDates(System.Collections.Generic.IEnumerable)

Specifies the disabled dates in the DateRangePicker widget.

Parameters

disableDates - System.Collections.Generic.IEnumerable<String>

Example


                 @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .DisableDates(new string[] { "we", "th" })
                )

DisableDates(System.DayOfWeek[])

Specifies the disabled dates in the DateRangePicker widget.

Parameters

days - System.DayOfWeek[]

Example


                 @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .DisableDates(DayofWeek.Saturday, DayOfWeek.Sunday)
                )

DisableDates(System.String)

Specifies the disabled dates handler in the DateRangePicker widget using a function.

Parameters

handler - System.String

Example


             @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .DisableDates("disableDates")
            )

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<DateRangePickerEventBuilder>

The client events action.

Example


               @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Events(events => events
                            .Change("onChange")
                        )
               )

ToComponent()

Returns the internal view component.

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name of the component.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
               .Name("grid")
               .Columns(columns =>
               {
                   columns.Bound(p => p.OrderID).Filterable(false);
                   columns.Bound(p => p.Freight);  
               })
               .DataSource(dataSource => dataSource
                   .Ajax()
                   .PageSize(20)
                   .Read(read => read.Action("Orders_Read", "Grid"))
               )
            )

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean)

Parameters

deferred - System.Boolean

ModelMetadata(System.Web.Mvc.ModelMetadata)

Uses the Metadata of the Model.

Parameters

modelMetadata - System.Web.Mvc.ModelMetadata

The metadata set for the Model

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

AsChildComponent()

Render()

Renders the component.

Example


            @(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
            @( Html.Kendo().Grid(Model)
                .Name("grid")
                .DetailTemplate(product => {
                    )
                       Product Details:
                       <div>Product Name: @( product.ProductName )</div>
                       <div>Units In Stock: @( product.UnitsInStock )</div>
                    @(
                })
                .Render();
            )

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?