Validating Data

The PropertyGrid control supports WPF data binding validation. Built-in editors support source-based validation using exceptions or IDataErrorInfo. Custom editors also support binding-based validation via the Binding.ValidationRules collection; if you need to perform binding-based validation, you will need to create a custom editor.

To override the default validation failure user interface (the red outline), set the Validation.ErrorTemplate property via a custom style, or create a custom editor or template that binds to the Validation.HasError property. Examples of both of these techniques are shown in the Templating sample. See the Customization and Styling and Templating sections for more information.