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

Defines the fluent API for configuring the Kendo UI DateInput

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class DateInputBuilder : MvvmWidgetBuilderBase<DateInput, DateInputBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<DateInput, DateInputBuilder>MvvmWidgetBuilderBase<DateInput, DateInputBuilder>DateInputBuilder

Implements: IHtmlContent

Inherited Members MvvmWidgetBuilderBase<DateInput, DateInputBuilder>.UseMvvmInitialization(bool)MvvmWidgetBuilderBase<DateInput, DateInputBuilder>.UseMvvmInitialization()WidgetBuilderBase<DateInput, DateInputBuilder>.ToComponent()WidgetBuilderBase<DateInput, DateInputBuilder>.Expression(string)WidgetBuilderBase<DateInput, DateInputBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<DateInput, DateInputBuilder>.Name(string)WidgetBuilderBase<DateInput, DateInputBuilder>.Deferred(bool)WidgetBuilderBase<DateInput, DateInputBuilder>.HtmlAttributes(object)WidgetBuilderBase<DateInput, DateInputBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<DateInput, DateInputBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<DateInput, DateInputBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<DateInput, DateInputBuilder>.Render()WidgetBuilderBase<DateInput, DateInputBuilder>.ToHtmlString()WidgetBuilderBase<DateInput, DateInputBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<DateInput, DateInputBuilder>.ToClientTemplate()WidgetBuilderBase<DateInput, DateInputBuilder>.AsModule(bool)WidgetBuilderBase<DateInput, DateInputBuilder>.ComponentWidgetBuilderBase<DateInput, DateInputBuilder>.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 DateInputBuilder class.

C#
public DateInputBuilder(DateInput component)
Parameters:componentDateInput

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 for AutoAdjust

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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

Sets a value that indicates whether to automatically correct the segment when out of range

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

The value for AutoCorrectParts

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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 for AutoSwitchKeys

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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()
Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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 for AutoSwitchParts

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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

A value indicating whether the mouse scroll can be used to increase/decrease the segments values

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

The value for EnableMouseWheel

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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

Returns the current DateInputBuilder instance.

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

Sets a value controlling how the color is applied.

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

The value for FillMode

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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

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

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

The value for Format

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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

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 DateInputBuilder InputMode(string value)
Parameters:valuestring

The value for InputMode

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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 DateInputLabelSettingsBuilder for the label setting.

Returns:

DateInputBuilder

Returns the current instance of DateInputBuilder .

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(string label)
Parameters:labelstring

The label.

Returns:

DateInputBuilder

Returns the current instance of DateInputBuilder .

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

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

The value for Max

Returns:

DateInputBuilder

A DateInputBuilder instance for method chaining.

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 value for Max

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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

The messages that DateInput uses. Use it to customize or localize the placeholders of each date/time part.

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

The DateInputMessagesSettingsBuilder for the messages setting.

Returns:

DateInputBuilder

Returns the current instance of DateInputBuilder .

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

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

The value for Min

Returns:

DateInputBuilder

A DateInputBuilder instance for method chaining.

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 value for Min

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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

Sets a value controlling the border radius.

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

The value for Rounded

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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 for Size

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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

An object with the different steps for incrementing/decrementing the various segments

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

The DateInputStepsSettingsBuilder for the steps setting.

Returns:

DateInputBuilder

Returns the current instance of DateInputBuilder .

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

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

The value for TwoDigitYearMax

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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

Specifies the selected date.

C#
public DateInputBuilder Value(DateOnly? value)
Parameters:valueDateOnly?

The value for Value

Returns:

DateInputBuilder

Specifies the selected date.

C#
public DateInputBuilder Value(DateOnly value)
Parameters:valueDateOnly

The value for Value

Returns:

DateInputBuilder

Specifies the selected date.

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

The value for the selected date.

Returns:

DateInputBuilder

A DateInputBuilder instance for method chaining.

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 for Value

Returns:

DateInputBuilder

Returns the current DateInputBuilder instance.

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

Specifies the selected time.

C#
public DateInputBuilder Value(TimeOnly? value)
Parameters:valueTimeOnly?

The value for Value

Returns:

DateInputBuilder

Specifies the selected time.

C#
public DateInputBuilder Value(TimeOnly value)
Parameters:valueTimeOnly

The value for Value

Returns:

DateInputBuilder