Hi,
I'm using a SfMaskedEdit control and trying to set the mask dynamically, I mean I have this mask (___) ___-____ for a phone number and I need to change the mask to this one (__) ____-____ at runtime when I press KeyUp, but what I'm getting when I write a phone number and change the mask is (122_123-1230. This is my code:
<syncfusion:SfMaskedEdit
x:Name="txtPhone"
Text="{Binding Customer.Telephone, Mode=TwoWay}"
Mask="(000)000-0000" KeyUp="SfMaskedEdit_KeyUp"/>
private void SfMaskedEdit_KeyUp(object sender, KeyRoutedEventArgs e)
{
if (e.Key == Windows.System.VirtualKey.Up)
{
txtPhone.Mask = "(000)000-0000";
txtPhone.Value = "(___)___-____";
txtPhone.Text = "(___)___-____";
}
else if (e.Key == Windows.System.VirtualKey.Down)
{
txtPhone.Mask = "(00)0000-0000";
txtPhone.Value = "(__)____-____";
txtPhone.Text = "(__)____-____";
}
}
Is it a bug or what am I doing wrong?
Thank you.