in a form, I Need to use a TextBox to enter values in the exponential form. In Radform's textboxes, there's no possibility to directly validate the Input or to Format it like ##.##e##. Is there a way to do this by radform or do I Need to write my own Input Validation and formatting?
3 Answers, 1 is accepted
0
George
Telerik team
answered on 26 Feb 2014, 03:14 PM
Hi Ueli,
Thank you for contacting us.
For this purpose you can use RadMaskedEditBox since its purpose is to provide such features. This is how you can configure it for your case:
this.MaskedEditBox.MaskType = MaskType.Standard;
this.MaskedEditBox.Mask = "##.##e##";
More information about RadMaskedEditBox can be found here.
unfortunately this doesn't work. I use the TextBox to enter data but as well to edit data. So I get the value of this TextBox from the database. The datatype there is float which is converted to double in the entity model. So the value is written as 500000 in the db and should be displayed as 5.00E05. I solved it now to convert it to a string and then back to a double value using try catch expressions to avoid wrong Input.
0
Peter
Telerik team
answered on 03 Mar 2014, 04:18 PM
Hi Ueli,
Thank you for writing back and for the clarifications.
I would like to clarify that RadMaskedEditBox uses as value of type object and you should keep this approach with manually converting values from/to (with float.TryParse) database value.
Also, you can try to inherit our RadMaskedEditBox and expose a Value property of type float which internally perform this cast: