This is a migrated thread and some comments may be shown as answers.
How to disable mask for MaskedTextBox
3 Answers 86 Views
This is a migrated thread and some comments may be shown as answers.
Konrad
Top achievements
Rank 1
Konrad asked on 23 Aug 2011, 01:03 PM
Hi, i use RadMaskedTextBox in my aspx:
<telerik:RadMaskedTextBox ID="edtNumber" runat="server" CssClass="EditBox" Width="300px"
    Mask="## #### #### #### #### #### ####"
 EnableEmbeddedSkins="false">
</telerik:RadMaskedTextBox>

But for some conditions I want to disable mask in codebehind. Is any way to do this, because this doesn't work:
edtNumber.Mask = null;
edtNumber.Mask = string.Empty;

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 23 Aug 2011, 02:17 PM
Hello Konrad,

Try setting DisplayMask as shown below.
C#:
if(condition)
{
    edtNumber.DisplayMask=" ";
}

Thanks,
Shinu.
0
Konrad
Top achievements
Rank 1
answered on 23 Aug 2011, 03:58 PM
Mask is invisible to the moment when I click the input. I would like to disable mask completely.
0
Konrad
Top achievements
Rank 1
answered on 26 Aug 2011, 09:24 AM
So ?

Edited:
Nevermind, I have used second textbox ... -.-
Tags
Input
Asked by
Konrad
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Konrad
Top achievements
Rank 1
Share this question
or