0

Is there a way to display validation errors (using Validation.Errors attached property) in the same layer as the control with the invalid value while using the Validation class?

What I want is to display errors beneath the control with the invalid value. But the error text should not overlap other controls, so the error text must be in the same layer as the control, or not?

Best Regards, Jesper

Krimson
  • 762
  • 6
  • 25

2 Answers2

1

One way to do this is to disable the Validation.ErrorTemplate for the Control and create your own handling of it within the Template of the Control. See this question for a way to get the Validation error to slide out of a TextBox when error occurs and slide back in when it is valid again. Sample application with this can be downloaded from here.

Community
  • 1
  • 1
Fredrik Hedblad
  • 83,499
  • 23
  • 264
  • 266
-1

Use Validation.ErrorTemplate. Here is an article that shows how to use it.

decyclone
  • 30,394
  • 6
  • 63
  • 80
  • 1
    I am using the Validation.ErrorTemplate, but it displays the error text in an adorner layer which is on top of the layer, where the controls are rendered – Krimson Nov 25 '10 at 10:05