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

RadMaskedTextBox Fixed Mask

1 Answer 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Yazan
Top achievements
Rank 1
Yazan asked on 19 Nov 2012, 09:08 PM
Hi,
I have a radmaskedtextbox that is intended for gender-input. the desired mask should accept only one of the following inputs: "m", "f", "M", "F", or "" (the empty ("") is obviously necessary to wait for the user to input the gender)

That's it, I can't discover the mask that should provided in the mask property.

Thank you for your help.

1 Answer, 1 is accepted

Sort by
0
Accepted
Kostadin
Telerik team
answered on 22 Nov 2012, 12:44 PM
Hello Yazan,

A possible approach is to build up a mask using the MaskParts property at runtime. Check out the following code snippet.
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        EnumerationMaskPart enumPart = new EnumerationMaskPart();
        enumPart.Items.Add("M");
        enumPart.Items.Add("m");
        enumPart.Items.Add("F");
        enumPart.Items.Add("f");
        enumPart.Items.Add("");
        RadMaskedTextBox1.MaskParts.Add(enumPart);
    }
}


Kind regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Yazan
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or