New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring the Kendo UI DateRangePicker

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class DateRangePickerBuilder : MvvmWidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>MvvmWidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>DateRangePickerBuilder

Implements: IHtmlContent

Inherited Members MvvmWidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.UseMvvmInitialization(bool)MvvmWidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.UseMvvmInitialization()WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.ToComponent()WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.Expression(string)WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.Name(string)WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.Deferred(bool)WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.HtmlAttributes(object)WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.Render()WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.ToHtmlString()WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.ToClientTemplate()WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.AsModule(bool)WidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.ComponentWidgetBuilderBase<DateRangePicker, DateRangePickerBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the DateRangePickerBuilder class.

C#
public DateRangePickerBuilder(DateRangePicker component)
Parameters:componentDateRangePicker

Methods

Specifies the adaptive rendering of the component.

C#
public DateRangePickerBuilder AdaptiveMode(AdaptiveMode value)
Parameters:valueAdaptiveMode

The value for AdaptiveMode

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Allows customization of the subtitle's text in the adaptive view of the component.

C#
public DateRangePickerBuilder AdaptiveSubtitle(string value)
Parameters:valuestring

The value for AdaptiveSubtitle

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Allows customization of the title's text in the adaptive view of the component.

C#
public DateRangePickerBuilder AdaptiveTitle(string value)
Parameters:valuestring

The value for AdaptiveTitle

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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

C#
public DateRangePickerBuilder AllowReverse()
Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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

C#
public DateRangePickerBuilder AllowReverse(bool value)
Parameters:valuebool

The value for AllowReverse

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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

C#
public DateRangePickerBuilder ARIATemplate(string value)
Parameters:valuestring

The value for ARIATemplate

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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

C#
public DateRangePickerBuilder ARIATemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the ariatemplate.

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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

C#
public DateRangePickerBuilder ARIATemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for ARIATemplate

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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

C#
public DateRangePickerBuilder ARIATemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for ARIATemplate

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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

C#
public DateRangePickerBuilder ARIATemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for ARIATemplate

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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.

C#
public DateRangePickerBuilder AutoAdjust(bool value)
Parameters:valuebool

The value for AutoAdjust

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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

C#
public DateRangePickerBuilder AutoClose(bool value)
Parameters:valuebool

The value for AutoClose

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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.

C#
public DateRangePickerBuilder CalendarButton()
Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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.

C#
public DateRangePickerBuilder CalendarButton(bool value)
Parameters:valuebool

The value for CalendarButton

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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.

C#
public DateRangePickerBuilder ClearButton()
Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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.

C#
public DateRangePickerBuilder ClearButton(bool value)
Parameters:valuebool

The value for ClearButton

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Specifies the culture info used by the component. A valid kendo culture file must be added to the page in order for the example to work. <script src="https://cdn.jsdelivr.net/npm/@progress/kendo-ui@{version}/umd/cultures/kendo.culture.de-DE.min.js"&gt;&lt;/script>

C#
public DateRangePickerBuilder Culture(string value)
Parameters:valuestring

The value for Culture

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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

C#
public DateRangePickerBuilder Dates(params DateTime[] value)
Parameters:valueDateTime[]

The value for Dates

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Specifies the navigation depth.

C#
public DateRangePickerBuilder Depth(CalendarView value)
Parameters:valueCalendarView

The value for Depth

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Specifies the disabled dates in the DateRangePicker widget.

C#
public DateRangePickerBuilder DisableDates(params DayOfWeek[] days)
Parameters:daysDayOfWeek[]Returns:

DateRangePickerBuilder

A reference to the current DateRangePickerBuilder instance, to allow for method chaining.

Example:
C#
@(Html.Kendo().DateRangePicker()
.Name("DateRangePicker")
.DisableDates(DayOfWeek.Saturday, DayOfWeek.Sunday)
)

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

C#
public DateRangePickerBuilder DisableDates(string handler)
Parameters:handlerstringReturns:

DateRangePickerBuilder

A reference to the current DateRangePickerBuilder instance, to allow for method chaining.

Example:
C#
@(Html.Kendo().DateRangePicker()
.Name("DateRangePicker")
.DisableDates("disableDates")
)

Specifies the end field name for model binding.

C#
public DateRangePickerBuilder EndField(string value)
Parameters:valuestring

The value for EndField

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Configures the client-side events.

C#
public DateRangePickerBuilder Events(Action<DateRangePickerEventBuilder> configurator)
Parameters:configuratorAction<DateRangePickerEventBuilder>

The client events action.

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Example:
C#
@(Html.Kendo().DateRangePicker()
.Name("DateRangePicker")
.Events(events =&gt; events
.Change("onChange")
)
)

Sets a value controlling how the color is applied.

C#
public DateRangePickerBuilder FillMode(FillMode value)
Parameters:valueFillMode

The value for FillMode

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

The template which renders the footer of the calendar. If false, the footer will not be rendered.

C#
public DateRangePickerBuilder Footer(string value)
Parameters:valuestring

The value for Footer

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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.

C#
public DateRangePickerBuilder Format(string value)
Parameters:valuestring

The value for Format

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Specifies the inputmode attribute of the inner <input /> element. It is used to specify the type of on-screen keyboard that should be displayed when the user focuses the input.

C#
public DateRangePickerBuilder InputMode(string value)
Parameters:valuestring

The value for InputMode

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Example:
C#
@(Html.Kendo().DateRangePicker()
.Name("dateRangePicker")
.InputMode("numeric")
)

Determines if the labels for the inputs will be visible.

C#
public DateRangePickerBuilder Labels(bool value)
Parameters:valuebool

The value for Labels

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Specifies the maximum date, which the calendar can show.

C#
public DateRangePickerBuilder Max(DateTime value)
Parameters:valueDateTime

The value for Max

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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

C#
public DateRangePickerBuilder Messages(Action<DateRangePickerMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<DateRangePickerMessagesSettingsBuilder>

The DateRangePickerMessagesSettingsBuilder for the messages setting.

Returns:

DateRangePickerBuilder

Returns the current instance of DateRangePickerBuilder .

Specifies the minimum date that the calendar can show.

C#
public DateRangePickerBuilder Min(DateTime value)
Parameters:valueDateTime

The value for Min

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Specifies the month template that will be displayed in the popup calendar.

C#
public DateRangePickerBuilder MonthTemplate(Action<MonthTemplateBuilder> configurator)
Parameters:configuratorAction<MonthTemplateBuilder>

The configurator for the monthtemplate setting.

Returns:

DateRangePickerBuilder

A reference to the current DateRangePickerBuilder instance, to allow for method chaining.

Example:
C#
@(Html.Kendo().DateRangePicker()
.Name("DateRangePicker")
.MonthTemplate(m =&gt; m.Content("#= data.value #"))
)

Configures the Kendo UI DateRangePicker range settings.

C#
public DateRangePickerBuilder Range(Action<DateRangePickerRangeSettingsBuilder> configurator)
Parameters:configuratorAction<DateRangePickerRangeSettingsBuilder>

The DateRangePickerRangeSettingsBuilder for the range setting.

Returns:

DateRangePickerBuilder

Returns the current instance of DateRangePickerBuilder .

Sets a value controlling the border radius.

C#
public DateRangePickerBuilder Rounded(Rounded value)
Parameters:valueRounded

The value for Rounded

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Sets the size of the component.

C#
public DateRangePickerBuilder Size(ComponentSize value)
Parameters:valueComponentSize

The value for Size

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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

C#
public DateRangePickerBuilder Start(CalendarView value)
Parameters:valueCalendarView

The value for Start

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

Specifies the start field name for model binding.

C#
public DateRangePickerBuilder StartField(string value)
Parameters:valuestring

The value for StartField

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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.

C#
public DateRangePickerBuilder WeekNumber()
Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.

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.

C#
public DateRangePickerBuilder WeekNumber(bool value)
Parameters:valuebool

The value for WeekNumber

Returns:

DateRangePickerBuilder

Returns the current DateRangePickerBuilder instance.