I have a MaskedEditBox called mtbText bound to a string property like this:
mtbText.DataBindings.Add(nameof(mtbText.Value), customerSearch, nameof(customerSearch.Text), false, DataSourceUpdateMode.OnPropertyChanged);
public string? Text
{
get => _text;
set
{
if (_text != value)
{
_text = value;
OnPropertyChanged(nameof(Text));
}
}
}
Sometimes I need a specific mask like SSN or phone # and sometimes I don't. The UI resets the properties on the single mask control depending on need. If I bind to a specific mask like this (say a SSN or phone #) it works fine. However sometimes I need a mask that will allow anything. I tried aaaaaaaaaa and a few other combination but these won't let me enter blank spaces. If I set the MaskType to None it allow the spaces but doesn't bind to the property.
mtbText.Mask = string.IsNullOrEmpty(item.Mask) ? "aaaaaaaaaa" : item.Mask;
mtbText.MaskType = MaskType.Standard;
mtbText.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
What mask can I use that would allow me to enter something like 123 Main Street and still bind to the object property.
Thanks
Carl