data validataion with collecion

Grids for WPF Forum

Posted 8 years ago by Mary Fontana - Rudolph Technologies
Version: 11.2.0553
Avatar

I have used the data validation on individual property items..

How can I get data validation on collection of items in a property grid?

So for example, if I have  a collection of integers,   how can I show  the data error on each item in collection?

Thanks

Comments (3)

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

Hi Mary,

Like any other WPF control, you would have to navigate the visual tree and collect the validation errors manually. Some examples can be found here. Those examples just check to see if there are errors, not gather them for display but the code would be similar.


Actipro Software Support

Posted 8 years ago by Mary Fontana - Rudolph Technologies
Avatar

I am doing something like this example now.

I have a custom  property editor with  my own validataion error template that has a tooltip to show the error text on the value template.

I have a class that uses IDataErrorInfo,  and for the  property field that is a collection, I  collect and show the validation for the first child that has  an error.

Each child is an instance of a class that uses IDataInfoErro and this class  also is defined to use  my custom error property editor, but I dont know how to trigger the validation on the child in the collection.

I would like the child's value field to show the  "red outlined" box  and tooltip  if there is an error. 

[Modified 8 years ago]

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

Hi Mary,

I'm sorry, I don't really understand your question. If you can please put together a small sample project that reproduces your issue and email it over then we can take a closer look. Be sure to remove any executables or change the extension of the zip file to ensure it gets past our email filters.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.