0
votes

In my WPF text box i have bound the integer entity variable and set the IntegerValidationAttribute. when i input text IDataErrorInfo is triggered with proper error info.

The issue is when i input the integer value more then int.MaxValue(2147483647) say i input 2147483649 the IDataErrorInfo error is not triggered.

I need to disable/Enable button depends on proper integer value validation.

Please suggest for the same.

Regards, Vivek

1
Is IntegerValidationAttribute custom? Have you tried the RangeAttribute?user7116
Yes, IntegerValidationAttribute is custom i have written.Vivek
your IDataErrorInfo is not triggered, because a BindingException is thrown, check your output window.blindmeis
@user698209: Have you tried adding ValidatesOnExceptions=True to the Binding? As blindmeis points out, the conversion performed by the type descriptor is failing, raising an exception.user7116
can you post your xaml binding, the integer property and the IDataErrorInfo and IntegerValidationAttributeblindmeis

1 Answers

0
votes

when you put somthing like "cclks" in your textbox, your validation will also not happen or?

if not then you have some sort of "numeric only textbox" and if you have such a textbox you can go further and create a "integer numeric only textbox"

i always use string properties in my viewmodels so i can easily validate all input, but of course i have to cast to the real type for my models