using PropertyProxyValidator with user controls

Topics: Validation Application Block
Sep 17, 2007 at 6:49 AM
is it possible to use propertyproxyvalidator for usercontrols and custom controls? lets say i have a user control named 'ctrlX' and property that i want to validate is exposed using "ctrlXHeight". if i set "controltovalidate" property of propertyproxyvalidator to "ctrlX", how can i set propertyproxyvalidator to read it value from "ctrlXHeight" property? is this a limitation? fingers crossed it's not.
Sep 17, 2007 at 2:59 PM
Hi,


keeara wrote:
is it possible to use propertyproxyvalidator for usercontrols and custom controls? lets say i have a user control named 'ctrlX' and property that i want to validate is exposed using "ctrlXHeight". if i set "controltovalidate" property of propertyproxyvalidator to "ctrlX", how can i set propertyproxyvalidator to read it value from "ctrlXHeight" property? is this a limitation? fingers crossed it's not.


You can set ctrlX's extended property ValidatedPropertyName to ctrlXHeight to accomplish this.

Hope this helps,
Fernando
Sep 18, 2007 at 12:04 AM
Hi Fernando,


fsimonazzi wrote:
You can set ctrlX's extended property ValidatedPropertyName to ctrlXHeight to accomplish this.


where can i get this validatedPropertyname?
Sep 18, 2007 at 1:31 PM
Hi,


where can i get this validatedPropertyname?


It should show up as "ValidatedProperty on your validation provider" on your control's properties. The default value is "Text".

Fernando
Sep 19, 2007 at 12:16 AM

It should show up as "ValidatedProperty on your validation provider" on your control's properties. The default value is "Text".


i couldn't figure this out. i couldn't find any such property in my control. i don't know what i have missed but good thing is i managed to solve the problem. in my custom control, i used ValidationPropertyAttribute with Attribute as the property of control that i want validated.

thanx for fernando.
Sep 19, 2007 at 12:27 PM
I'm very sorry, I misunderstood your scenario. I was thinking about WinForms integration, not ASP.NET integration.

I'm glad you figured it out.
Regards,
Fernando