This is a migrated thread and some comments may be shown as answers.

How to pass a ValidationContext into DataAnnotation validation

0 Answers 111 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Scott Waye
Top achievements
Rank 2
Iron
Veteran
Iron
Scott Waye asked on 27 Mar 2011, 07:36 PM
Hi,

As per the subject, I want to pass a custom ValidationContext class into the DataAnnotation validation methods in order to supply ServiceProviders.  Looking at GridViewDataControl,PerformDataAnnotationValidation,MoveNext it seems that it just creates a new vanilla ValidationContext with no provision for supplying your own.  By contrast the DomainContext in RiaServices has a ValidationContext property which you can set to achieve this.

Is there a way to supply a ValidationContext for DataAnnotation Validation so that when a new row is added to the grid, the custom ValidationContext is passed to the validation methods?

--
Scott

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Scott Waye
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or