How to disable mask for MaskedTextBox

4 posts, 0 answers
  1. Konrad
    Konrad avatar
    33 posts
    Member since:
    Aug 2010

    Posted 23 Aug 2011 Link to this post

    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;
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Aug 2011 Link to this post

    Hello Konrad,

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

    Thanks,
    Shinu.
  3. Konrad
    Konrad avatar
    33 posts
    Member since:
    Aug 2010

    Posted 23 Aug 2011 Link to this post

    Mask is invisible to the moment when I click the input. I would like to disable mask completely.
  4. Konrad
    Konrad avatar
    33 posts
    Member since:
    Aug 2010

    Posted 26 Aug 2011 Link to this post

    So ?

    Edited:
    Nevermind, I have used second textbox ... -.-
Back to Top