WPF databinding, int property and PropertyStatus control

WPF databinding, int property and PropertyStatus control

Old forum URL: forums.lhotka.net/forums/t/7891.aspx


fsl posted on Wednesday, October 28, 2009

Hi

I was wondering what the right way to do the following is. In a business object I have a managed csla property with the type of int. The property is bound to a textbox. ValidationRules are defined that specifies that the int must be lower than x, if violated an error message is displayed in a PropertyStatus control. But If the user enters non numerical characters in the textbox, I have no way of giving an appropriate error message in the PropertyStatus control.

Unsatisfying solutions:

I can use a converter that creates a popup message that displays an error message, stating that the entered text must be numerical.

Mask the textbox input, but theres no out of the box way of doing this in wpf..

Any ideas?

richardb replied on Wednesday, October 28, 2009

Faced with the same issue here but thankfully I persuaded my client to purchase some WPF controls from Infragistics which has a MaskedEditBox control that does the job.  I wanted then for the WPF grid and charting controls mostly.

I'd seriously look at some of the third party controls out there if possible.  They save a load of time.

Richard.

Copyright (c) Marimer LLC