Validating during an input

Grids for WPF Forum

Posted 11 years ago by Snupru - Germany
Version: 13.2.0591
Avatar

Is it possible to validate during a input?

[Modified 11 years ago]

Comments (7)

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

Hi,

Yes please take a look at the "Data Validation" QuickStart and documentation topic.  Those describe how to do so.


Actipro Software Support

Posted 11 years ago by Snupru - Germany
Avatar

I can't find any samples

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

Hello, the samples are installed with the product when you run the installer on you machine.  You can get to the sample project from the Windows all programs menu.  There will be a group of links for Actipro WPF Controls.


Actipro Software Support

Posted 11 years ago by Snupru - Germany
Avatar

I can't find any samples in the QuickStart or documentation.

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

Hello,

Both the "Data Validation" QuickStart and "Data Validation" documentation topic talk about and/or show how to validate the results of what an end user commits as a value.


Actipro Software Support

Posted 11 years ago by urbi
Avatar

Hello.

I'am working on the same issue as snupru and can't find any sample, too.

 

I tried to validate an input in the PropertyGrid on KeyUp-Event (while typing)

The QuickStart only show's validation when a end user commits a value.

 

Is there the possibility to handle/catch this event?

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

Hello, that is correct, the PropertyGrid validation is based around what is committed to the properties being edited.

If you want to validate while the end user is typing, that would be more of a function of the property editor in use for editing the property.  You can make custom property editors (also shown in the samples and documentation) that could use custom controls for input.  Then in those custom controls, you could block certain characters from being typed such as with KeyDown.

The only other thing you could do is if you have our default styles/templates, you could clone them and change the property editor template for the one you need here to bind the editor control (textbox, or whatever it is in the template) to have the binding UpdateSourceTrigger be on PropertyChanged instead of LostFocus.  That way our PropertyGrid validation code would kick in as the user types. 


Actipro Software Support

The latest build of this product (v24.1.3) was released 28 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.