Skip to main content

Microsoft Silverlight

Answered Question How to turn validation off dynamicllyRSS Feed

(0)

spatemp
spatemp

Member

Member

4 points

32 Posts

How to turn validation off dynamiclly

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
jeetumaker

Member

Member

525 points

92 Posts

Re: How to turn validation off dynamiclly

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.

I hope this helps. Please click on the "Mark as Answer" if it has answered your question.

Thanks
Jeetu Maker
http://jeetumaker.blogspot.com
(Light_up_your_apps) using Silverlight.2.0;

spatemp
spatemp

Member

Member

4 points

32 Posts

Answered Question

Re: Re: How to turn validation off dynamiclly

yea, the first approach make sense.  However, I was wondering how do you turn off notification from code behind. 

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities