I am happy to see you managed to resolve that question on your own.
For future questions of that sort I am posting two possible solutions (that you can, of course, combine):
Using the Min and Max parameters of the component:
<TelerikNumericTextBox @bind-Value="@TheValue"Min="-100"Max="10000"></TelerikNumericTextBox>
@code {
public int TheValue { get; set; }
}
Using Form Validation:
@using System.ComponentModel.DataAnnotations
<EditForm Model="@MyModel">
<DataAnnotationsValidator />
<ValidationSummary />
<TelerikNumericTextBox @bind-Value="@MyModel.TheValue"></TelerikNumericTextBox>
</EditForm>
@code {
MyDataModel MyModel = new MyDataModel();
publicclassMyDataModel
{
[Range(-100, 1000, ErrorMessage = "The number should be between {1} and {2}")]
publicint TheValue { get; set; }
}
}
Regards,
Svetoslav Dimitrov
Progress Telerik
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.