views:

65

answers:

0

Hi,

is there a way to programmatically set and remove the ErrorTemplate of an Control without the whole Validation mechanism? Basically, what I'd like to do, is to retrieve the ErrorTemplate of an Control at some point like this:

ControlTemplate errTemplate = Validation.GetErrorTemplate(myTxtBx);

and temporarily use it as it's ControlTemplate like this:

myTxtBx.Template = errTemplate;

Can you somehow do this?