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

Input Mask for Latitude, Longitude

2 Answers 627 Views
Map
This is a migrated thread and some comments may be shown as answers.
Reid
Top achievements
Rank 2
Reid asked on 23 Jun 2011, 07:50 PM
Hi,

Does someone have a working Mask for inputting a Longitude and Latitude that can be used for the RadMaskedTextBox?
If you could share it I would appreciated it.

I have tried "0000\.0000000" which does not work. 

I also tried "####.######" or "0000.000000".  These work in general and allow the minus sign for negative values but does not align the value to the left of the decimal point correctly.  You can enter a value to the left of the decimal that only has two digits, in other words the mask allows for empty spaces.   I need to make sure the digits to the left of the decimal right align.

Thanks,
Reid

2 Answers, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 29 Jun 2011, 07:48 AM
Hello Reid,

I am not sure you will be able to achieve this using the standard (text) mask. String values are always left to right aligned so you would need a numeric mask. For the RadMaskedTextBox you can use a mask like n5, allowing 5 digits after the decimal point. To restrict the digits begore the decimal point, you would have to handle the ValueChanging event and Handle it appropriately.

You can also try the RadMaskedNumericInput, with a mask of #4.5. To make it behave and look like the scenario you are trying to achieve, you can set the following properties as well :

AutoFillNumberGroupSeparators="False"
AllowSkipPlaceholders="True"
SelectionOnFocus="CaretToBeginning"
UpdateValueEvent="LostFocus"

Please let me know if you have questions on this.


Greetings,
Alex Fidanov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Reid
Top achievements
Rank 2
answered on 29 Jun 2011, 03:43 PM
Hello Alex,

Thank you for the detailed response.  I put in place everything and it seems to work for positive numbers.  If this UI concept of allowing the input of raw long/lat values stays in place I think there needs to be the ability to enter negative numbers. 

But with further consideration I need to re-think this piece and just cache the locations and present them in text form in a drop down. This app is an application for a driver so punching in precise long/lat should not be needed.

Thank you for your help.

Reid 
Tags
Map
Asked by
Reid
Top achievements
Rank 2
Answers by
Alex Fidanov
Telerik team
Reid
Top achievements
Rank 2
Share this question
or