RadzenTextbox allow only numbers

I have the following problem. I have in my model a string property that must accept only numbers. (e.g. phone number or customer code). Why string? because the customer code for example might start with zero (0). In case i will use any numeric type, like int for example the result will not have the zero and i will probably search for different customer. So my problem is that i have a string property in my model that should accept only numbers. I need the RadzenTextbox to filtered and allow only numeric inputs. Is that possible? I tried also the RadzenNumeric to bind it in that property but it does not update the model if i change the value.

Best Regards


Hi @thomaska,

The RadzenNumeric component supports only numeric types - int, double, decimal etc. One possible solution is to use the RadzenTextBox with a RegexValidator. The other is to handle the DOM input event and filter non numeric characters.