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

GridMaskedColumn

1 Answer 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 22 Aug 2011, 05:24 PM
Hi,

When I specify a mask, is there a setting to make sure the user enters it entirely? For example, for phone numbers: (###) ###-####, I would want the user to enter all digits and not partial. I would want (602) 555-1212 instead of (602) 5.

Thx
G

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 25 Aug 2011, 08:57 AM
Hello George,

You can achieve the desired functionality by using a RegularExpressionValidator:

<telerik:RadMaskedTextBox runat="server" ID="RadMaskedTextBox1" Mask="(###) ###-####">
</telerik:RadMaskedTextBox>
<asp:RegularExpressionValidator runat="server" ID="RegExValidator1" ControlToValidate="RadMaskedTextBox1"
    ValidationExpression="\([0-9]{3}\)\s{1}[0-9]{3}-[0-9]{4}" ErrorMessage="**"></asp:RegularExpressionValidator>

I hope this helps.

Regards,
Martin
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Grid
Asked by
George
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or