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

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

Definition

Constructors

Initializes a new instance of the DateInput class.

C#
public DateInputBuilder(DateInput component)
Parameters:componentDateInput

The component.

Example:
C#
@( Html.Kendo().DateInput()
.Name("dateinput")
.Events(events => events
.Add("handler")
)
)

Methods

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 DateInputBuilder AutoAdjust(bool value)
Parameters:valuebool

The value that configures the autoadjust.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.AutoAdjust(true)
)

Specifies whether automatically corrects the segment when out of range.

C#
public DateInputBuilder AutoCorrectParts(bool value)
Parameters:valuebool

The boolean value.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.AutoCorrectParts(true)
)

A string array representing keys that when pressed will force a move to the next segment. By default the culture specific symbols that match '/' and ':' are used.

C#
public DateInputBuilder AutoSwitchKeys(params string[] value)
Parameters:valuestring[]

The value that configures the keys.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.AutoSwitchKeys("-", "=")
)

A value indicating whether to automatically move to the next segment after a valid value is provided for the current

C#
public DateInputBuilder AutoSwitchParts(bool value)
Parameters:valuebool

The value that configures the autoswitchparts.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.AutoSwitchParts(true)
)

Specifies whether the mouse scroll can be used to increase/decrease the segment values.

C#
public DateInputBuilder EnableMouseWheel(bool value)
Parameters:valuebool

The boolean value.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.EnableMouseWheel(true)
)

Configures the client-side events.

C#
public DateInputBuilder Events(Action<DateInputEventBuilder> configurator)
Parameters:configuratorAction<DateInputEventBuilder>

The client events action.

Returns:

DateInputBuilder

Example:
C#
@( Html.Kendo().DateInput()
.Name("dateInput")
.Events(events =&gt; events
.Change("handler")
)
)

Sets the type of the fillMode option that controls how the color is applied to the rendered input.

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

The value that configures the fillmode.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.FillMode(FillMode.Solid)
)

Specifies the format of the value displayed in the input. The format also will be used to parse the input.

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

The value that configures the format.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Format("yyyy/MM/dd")
)

Defines the "inputmode" attribute of the inner <input /> element. The attribute specifies the type of on-screen keyboard displayed when the user focuses the input.

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

The value that configures the "inputmode" attribute.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateInput")
.InputMode("numeric")
)

Adds a label before the dateinput. If the dateinput has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.

C#
public DateInputBuilder Label(Action<DateInputLabelSettingsBuilder> configurator)
Parameters:configuratorAction<DateInputLabelSettingsBuilder>

The action that configures the label.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Label(l =&gt; l.Content("Enter a date..."))
)

Specifies the maximum date which can be entered in the input.

C#
public DateInputBuilder Max(DateTime? value)
Parameters:valueDateTime?

The DateTime value that sets the maximum date.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Max(new DateTime(2025,3,15))
)

Specifies the maximum date which can be entered in the input.

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

The DateTime value that sets the maximum date.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Max(new DateTime(2025,3,15))
)

The DateInput messages for customization or localization of the placeholders of each date/time part.

C#
public DateInputBuilder Messages(Action<DateInputMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<DateInputMessagesSettingsBuilder>

The action that configures the messages.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Messages(m =&gt;m.Year("year"))
)

Specifies the minimum date that which be entered in the input.

C#
public DateInputBuilder Min(DateTime? value)
Parameters:valueDateTime?

The DateTime value that sets the minimum date.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Min(new DateTime(2025,3,15))
)

Specifies the minimum date that which be entered in the input.

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

The DateTime value that sets the minimum date.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Min(new DateTime(2025,3,15))
)

Sets the size of the border radius of the rendered input.

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

The value that configures the border radius.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Rounded(Rounded.Large)
)

Sets the size of the component.

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

The value that configures the size.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Size(ComponentSize.Large)
)

Specifies the steps for incrementing/decrementing the different segments.

C#
public DateInputBuilder Steps(Action<DateInputStepsSettingsBuilder> configurator)
Parameters:configuratorAction<DateInputStepsSettingsBuilder>

The action that configures the steps.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Steps(s =&gt; s.Day(5))
)

Sets the maximum year value that is considered part of the current century.

C#
public DateInputBuilder TwoDigitYearMax(double value)
Parameters:valuedouble

The value that configures the TwoDigitYearMax.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.TwoDigitYearMax(28)
)

Specifies the selected date.

C#
public DateInputBuilder Value(DateTime? value)
Parameters:valueDateTime?

The value that configures the selected date.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Value(new DateTime(2025,3,15))
)

Specifies the selected date.

C#
public DateInputBuilder Value(DateTime value)
Parameters:valueDateTime

The value that configures the selected date.

Returns:

DateInputBuilder

Example:
C#
@(Html.Kendo().DateInput()
.Name("dateinput")
.Value(new DateTime(2025,3,15))
)