Last Updated: 14 Mar 2016 12:08 by ADMIN
Created on: 10 Mar 2016 01:32
Category: PropertyGrid
Type: Feature Request
radpropertygrid validation using "property sets" feature
I understand from, that there are essentially two methods to implement data validation in a RadPropertyGrid.  Note that I would like to use the "property set" feature of RadPropertyGrid whereby I can display/edit properties from multiple items simultaneously (

I was only able to get the second validation technique (data annotations) to work when using property sets.  Should the first technique (IDataErrorInfo) work with the property sets feature?  Towards the end of the discussion here, this topic is touched on, but it is not clear if it was ever resolved.

If it is not possible to use the IDataErrorInfo technique with property sets, I suggest the documentation at be updated to reflect this fact.  Separately, is there a target date for when this feature may be added?

If it is possible to use the IDataErrorInfo technique with property sets, would someone kindly post a sample solution?
1 comment
Posted on: 14 Mar 2016 12:08
RadPropertyGrid exposes PropertySetsValidationFunction property that enable the validation of property sets. It can be used as follows:

 this.rpg.PropertySetsValidationFunction = new Func<string, object, string>((s, t) => { return this.Validate(s, t); });

Where Validate method is: 
public string Validate(string c, object b)
			if (c == "StadiumCapacity" && b != null && (int)b > 100)
				return "StadiumCapacity should be less than 100!";
				return null;

NotifyOnValidationError and ValidatesOnDataErrors properties of the property definitions bindings should be set to true.