This is a migrated thread and some comments may be shown as answers.

Masked Edit Box

3 Answers 160 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Robert Gouin
Top achievements
Rank 1
Robert Gouin asked on 08 Mar 2011, 06:34 PM
Is there a way that you can allow people to use this text box to either enter feet and inches or just inches for their height and get the value just in inches?

3 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 08 Mar 2011, 07:38 PM
Hello Robert,

You may be better off using two RadSpinEditors for this, using a Max value of 12 for the inches and something else sensible (7?) for the feet.
 
There is also this article on Code Project which you may be interested in. Bear in mind though of course that this is not a Telerik solution, and is only using the standard Microsoft controls.

I hope that this helps, but let me know if you need more information
Richard
0
Guss
Top achievements
Rank 2
Veteran
answered on 19 Sep 2016, 11:26 AM

An easy cheat is:

DecimalSeparator="'"

Make the decimal seperator a single quote (feet). Then user type exactly as you speak.. "I'm 6 foot 3"    and you type it 6'3    
Then what ever you do with the value which is 6.3 (six, with a decimal 3) is you choice. (Split the value on the ".", and then you know its 6'3" and convert and store it in an STANDARD INTERNATIONAL format. The conversion can be done easy in your SQL stored procedure.   
I have a numeric textbox with a dropdown next to it where the person choose m, cm, mm or " ' and then that goes to the stored procedure and I handle it there... I store everyone's height in my choice (cm in my case). My select stored procedure, look at the users user preference (lenght measurement) and then know how to transform the value.

When the dropdownbox builds, I set group separator, decimal separator, max. min, etc, based on the users' choice of lenght measurement.

Similar I do for weight, volume, temprature.

0
Hristo
Telerik team
answered on 20 Sep 2016, 04:39 PM
Hi Guss,

Thank you for updating the thread.

I am sure the community will benefit from your reply.

Should you further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
Tags
MaskedEditBox
Asked by
Robert Gouin
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Guss
Top achievements
Rank 2
Veteran
Hristo
Telerik team
Share this question
or