I have a XamMaskedEditor for phone number. When there is no number entered, it leaves back literals(--) in the TextBlock. With options of DisplayMode to Raw or IncludePromtChars, there is no change in the behavior. How to empty the textblock, if no number is typed?
Thanks in advance.
Hello Gayathri,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I handled the XamMaskedInput’s ValueChanged event and in the handler I change the Mask if there is value or not. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
<ig:TemplateColumn.EditorTemplate>
<DataTemplate>
<ig:XamMaskedEditor Mask="999-999-9999CCCCCCCC" x:Name="xamMaskEditor" Value="{Binding PhoneNumber, Mode=Twoway}" AcceptsReturn="True" />
</DataTemplate>
</ig:TemplateColumn.EditorTemplate>
How do I access maskedEditor inside valuechanged event. Can you show me a sample code?. Thanks.
You can handle the XamMaskedInput's ValueChanged event directly and in the handler you can cast the sender to XamMaskedInput in order to get it.
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Thank you for checking Stephan, Actually the phone number is binded with a property called phonenumber. After the value changed event, it goes to a onpropertychanged event and assigns the same value again. This is a code written by someone and I am debugging it. So still looking for some work arounds in the present code.
Let me know if you have any ideas.