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

DateRangePickerBuilder

Defines the fluent API for configuring the Kendo DateRangePicker for ASP.NET MVC.

Methods

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.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .ARIATemplate("Date: #=kendo.toString(data.current, 'G')#")
               )

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.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .ARIATemplateId("ariaTemplate")
              )

Culture(System.String)

Specifies the culture info used by the widget.

Parameters

value - System.String

The value that configures the culture.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Culture("de-DE")
              )

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.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Dates(new DateTime(2000,10,10), new DateTime(2000,10,30))
              )

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.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Depth("month")
              )

EndField(System.String)

Specifies the end field name for model binding.

Parameters

value - System.String

The value that configures the endfield.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .EndField("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.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Footer("Today - #: kendo.toString(data, 'd') #")
              )

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.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Format("yyyy/MM/dd")
              )

Max(System.DateTime)

Specifies the maximum date, which the calendar can show.

Parameters

value - System.DateTime

The value that configures the max.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Max(DateTime.Now)
              )

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.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Messages(m => {
                             m.StartLabel("Start");
                             m.EndLabel("End");
                        })
              )

Min(System.DateTime)

Specifies the minimum date that the calendar can show.

Parameters

value - System.DateTime

The value that configures the min.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Min(DateTime.Now)
              )

Month(System.Action)

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

Parameters

configurator - System.Action<DateRangePickerMonthSettingsBuilder>

The action that configures the month.

Example

 ");
                                 m.Empty("-");
                            })
                        )

Labels(System.Boolean)

Determines if the labels for the inputs will be visible.

Parameters

value - System.Boolean

The value that configures the labels.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Labels(false)
              )

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.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .WeekNumber(true)
              )

Range(System.Action)

Configures the Kendo UI DateRangePicker range settings.

Parameters

configurator - System.Action<DateRangePickerRangeSettingsBuilder>

The action that configures the range.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Range(r => r.Start(DateTime.Now).End(DateTime.Now.AddDays(10)))
              )

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.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Range(r => r.Start(DateTime.Now))
              )

StartField(System.String)

Specifies the start field name for model binding.

Parameters

value - System.String

The value that configures the startfield.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .StartField("startField")
              )

Size(Kendo.Mvc.UI.ComponentSize)

Sets the size of the component.

Parameters

value - ComponentSize

The value that configures the size.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Size(ComponentSize.Medium)
              )

Rounded(Kendo.Mvc.UI.Rounded)

Sets a value controlling the border radius.

Parameters

value - Rounded

The value that configures the rounded.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .Rounded(Rounded.Medium)
              )

FillMode(Kendo.Mvc.UI.FillMode)

Sets a value controlling how the color is applied.

Parameters

value - FillMode

The value that configures the fillmode.

Example


              @(Html.Kendo().DateRangePicker()
                        .Name("DateRangePicker")
                        .FillMode(FillMode.Outline)
              )

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>

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?