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

Set mask from cs

1 Answer 9 Views
Input
This is a migrated thread and some comments may be shown as answers.
Katya
Top achievements
Rank 1
Katya asked on 03 Jul 2013, 02:55 AM
Hi

How can I set the mask of radmaskedtextbox from cs?

Thanks for replying
Katya

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 03 Jul 2013, 05:25 AM
Hi,

At run time, you can set the mask in the following ways:

C#:
RadMaskedTextBox1.Mask = "(###) ### - ####";

Then another method is Build up a mask using the MaskParts property:

C#:
EnumerationMaskPart enumPart = new EnumerationMaskPart();
enumPart.Items.Add("Mon");
enumPart.Items.Add("Tue");
enumPart.Items.Add("Wed");
enumPart.Items.Add("Thu");
enumPart.Items.Add("Fri");
enumPart.Items.Add("Sat");
enumPart.Items.Add("Sun");
RadMaskedTextBox1.MaskParts.Add(enumPart);
LiteralMaskPart literalPart = new LiteralMaskPart();
literalPart.Text = " ";
RadMaskedTextBox1.MaskParts.Add(literalPart);
RadMaskedTextBox1.MaskParts.Add(new DigitMaskPart());

Thanks,
Shinu.
Tags
Input
Asked by
Katya
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or