Exception at MaskedTextBox (v14.1) ?

Editors for WPF Forum

Posted 10 years ago by Marcus Steinbauer
Version: 14.1.0601
Avatar

Hi,

has anyone also Problems with the MaskedTextBox (v14.1)?
I always get an exception when text is updated : "object reference not set to an instance of an object"

Here is the stacktrace:

at ActiproSoftware.Windows.Controls.Editors.MaskedTextBox.SetText(String text)
at ActiproSoftware.Windows.Controls.Editors.MaskedTextBox.OnTextPropertyValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.Activate(Object item)
at System.Windows.Data.BindingExpression.OnDataContextChanged(DependencyObject contextElement)
...

Any ideas?

Thanks

Marcus

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Marcus,

We haven't seen that before.  Can you make a new simple sample project that shows it and send that to our support address in an email that references this thread?  Be sure to rename the .zip file extension so it doesn't get spam blocked.  We will use that to debug the problem.  You should be able to reproduce something like this if the same DataContext is set that triggers the issue.  Thanks!


Actipro Software Support

Answer - Posted 10 years ago by Marcus Steinbauer
Avatar

Hi,

I've found the problem:
If you use a MasekdTextBox you have to set "Mask"-Property. (if you dont wat to mask the text use: Mask="")
This seems to be new since Actipro v14.1.

Marcus

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Marcus,

It doesn't look like that class has been changed in years, at least in ways that would affect this scenario.  I did just add some code to do a null check though before the code that I think might be causing the problem.  It will be in the next version.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.