How do you get data validation working in a category editor?

Grids for WPF Forum

Posted 5 years ago by Doug Witt
Version: 19.1.0681
Avatar

I have category editors that have components on them that are tied to properties that throw exceptions when an invalid value is set.  The exception is caught, but the property grid does not show the error dialog.  I would also like to show the red border around my component when the value is invalid.

Do you have any examples of how to make this work?

Comments (4)

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

Hi Doug,

Our "PropertyGridDataValidation" QuickStart shows an example of how to configure a TextBox binding to validate on exceptions or data errors.  If you set up the similar binding in your category editor, does it work?


Actipro Software Support

Posted 5 years ago by Doug Witt
Avatar

No, the data validation does not work.  You can look at your own "Category Editors" QuickStart to see the issue.  If you put an invalid value in the Font.Size property of the property grid, you get the validation feedback.  If you do the same in the category editor, nothing happens, even though the TextBox has ValidatesOnException set to true.

If you could please show me how you would get the data validation working for the Font.Size property in the category editor in your "Category Editors" QuickStart, that may give me enough information to get mine working.

Thank you

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

Hi Doug,

I just opened our Category Editors QuickStart and typed "aa" in both the "FontSize" property in the left PropertyGrid and in the "Size" TextBox in the right PropertyGrid's category editor and both showed a red box when I did so.  You don't see that?


Actipro Software Support

Posted 5 years ago by Doug Witt
Avatar

Yes, I see it now.  I was trying to use the Enter key to commit the values. 

The issue I was having had to do with a .net issue.  

Thank you for your help.

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.