Kendo ui NumericTextBoxFor - Set startup values

2

How can I set a default boot value for the Kendo NumericTextBoxFor field.

Ex: My field is initialized in white. I want it to come with a default defined by me:

@(Html.Kendo().NumericTextBoxFor(model => model.MinVoltage).Name("MinVoltage").HtmlAttributes(new { style = "width: 6em;font-size:12px;font-weight:normal" }))
@Html.ValidationMessageFor(model => model.MinVoltage)

My model looks like this:

    [Column("MIN_VOLTAGE")]
    [Required(ErrorMessage = "Campo obrigatório")]
    [Display(ResourceType = typeof(Messages), Name = "MinimuVoltage")]
    [Range(0.1, 99.99, ErrorMessage = "Valores válidos: 0.1 a 99.99 ")]
    public double MinVoltage { get; set; }

I set a Range value, and I want it to start by default with the value 0.1, However, the field is initialized with no default value as shown above.

How can I set a default boot value for the NumericTextBoxFor field?

    
asked by anonymous 10.07.2017 / 20:09

1 answer

0

Use .Value (0.1) to set default value.

For the range use .Min (0.1) and .Max (99.99)

To configure the increment use .Step (0.1)

You may have to configure the .Format () format and if you can not get it with NumericTextBoxForModel use .NumericTextBox ()

    
11.09.2017 / 19:44