This is doable. I did not configure a validator under the Self node, this note from the entlib hands on lab explains why:
"Integration with Windows Forms' validation mechanism utilizes the validation rules associated with a business object, but no instance of the validated type is actually used. Self-validation relies on methods on the validated type, so the validation
rules implemented by such methods cannot be used to validate user input."
This is how I do it:
Added the type String in the configuration. Added a rule set and choose the Length property and configured a RangeValidator for it. Set the upper and lower bound and bound type. I have a validation provider named
stringValidationProvider, I set the SourceTypeName property to System.String, mscorlib. For the textbox that will be validated, I set the ValidatedProperty on stringValidationProvider property to "TextLength" and "Length"
for the SourcePropertyName on stringValidationProvider property.
Hope this helps.
Global Technology and Solutions