If these 5 symbols will include the decimal part as well, I can suggest using the change event and checking the length of the value. If the value length is bigger then 5, do not set the value as show a message to the user;
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Thank you for the response! I used the suggested approach and was able to set maxLength to the NumericTextBox.
This approach works fine if the number is a whole number. What should I do if I have to put maxLength restriction on a field with decimal values?
For example,
I have a field for which maxLength should be 5 characters and user should be able to enter maximum of 2 digits after decimal. If I put maxLength restriction on the field where I have set the format property as "#.##", the digits after decimal are removed and the value of the field is rounded off to a whole number if the max length limit is crossed.
Thanks,
Sadaf Patwekar
Stefan
Telerik team
commented on 26 Mar 2019, 09:19 AM
Hello, Sadaf,
If the combined length of the whole number + decimals has to be 5 I can suggest removing the decimal separator(culture-specific). This will count all numbers as one type:
If the max length has to be only for the whole number, then remove everything after the decimal separator before making the check.
Let me know if I missed some important detail.
Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items