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

RadMaskedTextBox doesn't aligns properly - phone number

12 Answers 396 Views
Input
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 04 Jul 2008, 06:26 PM
Hi,

I'm working with the RadMaskedTextBox to input telephone numbers with ext.
The problem that I have is when my phone number doesn't have a extension the value of the control is right aligned. 

Here are my lines : 

<telerik:RadMaskedTextBox ID="rmtbTel" runat="server" Width="103px"  Skin="Default2006" DisplayFormatPosition="left" DisplayMask="###.###.####x#####" Mask="###############" Enabled="False">
</telerik:RadMaskedTextBox>

I'm using ASP.NET AJAX Q1 2008 SP2 (Version Number 2008.1.619):.

Thanks for helping,

12 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 07 Jul 2008, 01:06 PM
Hi David,

Please try to set the NumericRangeAlign="Left" for the MaskedTextBox . Test this property setting and let us know if this helps.

Best regards,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
David
Top achievements
Rank 1
answered on 07 Jul 2008, 01:51 PM
It's still not working. Here are my lines :

<telerik:RadMaskedTextBox ID="rmtbTel" runat="server" Width="103px" Skin="Default2006" DisplayMask="###.###.####x#####" Mask="###############" NumericRangeAlign="left" Enabled="False"> </telerik:RadMaskedTextBox>

The NumericRangeAlign="left" has not changed the way where the digits are displayed for my phone number. The 9 digits (123.456.7890) are still going on the right side of my textbox where is located my extension part.

Any other ideas ??

Dave

0
Maria Ilieva
Telerik team
answered on 08 Jul 2008, 12:19 PM
Hello David,

It seems that the presented issue is a bug of the RadMaskedTextBox. I will forward this problem to our developers so they will further research on its future fixing.
Thank you for bringing this to our attention.

Regards,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jeremy Wadsworth
Top achievements
Rank 1
answered on 22 Mar 2009, 10:04 PM
It appears this issue has not been resolved. I'm using Q1 2009 ASP.NET AJAX. I have the following code:

                        <telerik:RadMaskedTextBox ID="PhoneNumber" runat="server"  
                            Width="150px"  
                            Text='<%# Eval("PhoneNumber") %>'  
                            Mask="(###) ###-#### x#####"  
                            DisplayMask="(###) ###-#### x#####"  
                            NumericRangeAlign="Left"
                        </telerik:RadMaskedTextBox> 

When the focus is in the textbox, the phone number with no extension displays fine. As soon as the textbox loses focus, all the numbers shift to the right and it looks like (___) __5-5555 x55555.

0
Iana Tsolova
Telerik team
answered on 24 Mar 2009, 03:40 PM
Hi Jeremy,

Indeed, this is the expected and intended by design behavior of RadMaskedTextBox. This way the control indicates that not the whole input is entered, that not the whole mask is covered.
You can check it out here

Kind regards,
Iana
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Kenyon Fox
Top achievements
Rank 1
answered on 24 Mar 2009, 04:06 PM
I think the point of this original post has been lost in translation...let's see if I can't clear things up a little because I am encountering the same situation.

I believe what Jeremy is getting at is that he wants to have a masked textbox that will capture a telephone number with an optional extension...meaning the user can enter a telephone number with or without an extension.  The way he has it confirgured currently...
                                
                        <telerik:RadMaskedTextBox ID="PhoneNumber" runat="server"  
                            Width="150px"  
                            Text='<%# Eval("PhoneNumber") %>'  
                            Mask="(###) ###-#### x#####"  
                            DisplayMask="(###) ###-#### x#####"  
                            NumericRangeAlign="Left"
                        </telerik:RadMaskedTextBox>

This configuration basically requires that the user enter an extension of exactly 5 numbers.  My question (and I think Jeremy's question as well) is how do we configure the masked textbox to have the extension part of the mask be optional?

So if the user enters an extension, the result will look like ... (555) 555-5555 x55555 and if the user does not enter an extension the result would look like ... (555) 555-5555 x_____

Hopefully that make's better sense.  I can see this being a common scenario with phone numbers, zip codes, addresses, etc...

Regards,
Kenyon
0
Jeremy Wadsworth
Top achievements
Rank 1
answered on 24 Mar 2009, 04:14 PM
Thank you Kenyon, you explained it exactly.
0
Iana Tsolova
Telerik team
answered on 26 Mar 2009, 03:27 PM
Hi Jeremy and Kenyon,

Thank you, Kenyon, for your detailed explanation. Now I was able to observer the undesired behavior. But unfortunately this is the way RadMaskedTextBox is made to work. However, I will need to further check if that could be changed or if I can provide you a workaround.
I will write back here for al interested.

Sincerely yours,
Iana
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Jeremy Wadsworth
Top achievements
Rank 1
answered on 13 Jun 2009, 05:01 PM
HI. I'm still hoping for a work around for this issue. Is there any way to get those numbers to shift to the left, or not shift to the right after the textbox loses focus?

Thanks,

Jeremy
0
Iana Tsolova
Telerik team
answered on 15 Jun 2009, 12:16 PM
Hello Jeremy,

Could you please try updating to the latest version of the controls and see if the issue persists there?

Let me know how it goes.

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jeremy Wadsworth
Top achievements
Rank 1
answered on 15 Jun 2009, 04:20 PM
Thank. It seems to be working after removing the DisplayMask. For clarity for everyone else.

This causes the issue.
<telerik:RadMaskedTextBox ID="PhoneNumber" runat="server"   
    Width="120"   
    Mask="(###) ###-#### ext.#####"   
    DisplayMask="(###) ###-#### ext.#####">  
</telerik:RadMaskedTextBox> 

This works great.
<telerik:RadMaskedTextBox ID="PhoneNumber" runat="server"   
    Width="120"   
    Mask="(###) ###-#### ext.#####">  
</telerik:RadMaskedTextBox> 
0
JB
Top achievements
Rank 1
answered on 23 Feb 2011, 06:28 PM
sorry wrong forum....
Tags
Input
Asked by
David
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
David
Top achievements
Rank 1
Jeremy Wadsworth
Top achievements
Rank 1
Iana Tsolova
Telerik team
Kenyon Fox
Top achievements
Rank 1
JB
Top achievements
Rank 1
Share this question
or