Skip to main content
Home Forums Silverlight Programming Programming with .NET - General How to turn validation off dynamiclly
2 replies. Latest Post by spatemp on November 7, 2009.
(0)
spatemp
Member
7 points
36 Posts
11-06-2009 9:02 PM |
I have datagrid in silverlight 3 where I am binding collection of objects to it. One of the column/property of this grid/object has validation to make sure that value is > 0. I would like to turn that validation off based on the user that is logged in.
How do I turn off validation from C# code behind dynamiclly.
Thanks.
jeetumaker
525 points
92 Posts
11-07-2009 5:08 AM |
Since your validation is based on the user log in, I would perform the validation in the property setter of the desired colum based on some static global/class level flag. In your Silverlight app you can set this flag based on the user log in while logging in. This way the validation check is performed only when required. If you turn off validation notifications in Silverlight, you will not get error messages but your data source will not get updated either. Hence I would rather go with the first approach.
11-07-2009 8:12 AM |
yea, the first approach make sense. However, I was wondering how do you turn off notification from code behind.