How to get rid of the red border around textbox automatically used for validation purposes?
Asked
Active
Viewed 7,401 times
7
-
what is your xaml of this textbox? Are you using any bindings? – Łukasz Wiatrak Oct 09 '11 at 15:12
2 Answers
16
Easiest way to do this:
<TextBox Validation.ErrorTemplate="{x:Null}">

BlueM
- 6,523
- 1
- 25
- 30
-
1Thanks for answering, but the very same answer is provided in the thread that Rohit references to. – Ondrej Janacek Feb 15 '16 at 13:12
4
Set the ValidatesOnDataErrors and ValidatesOnExceptions to False for your binding of your textbox. In case you want your validations, then you have to ovveride the Validation Template for your control. Please refer to my answer here- How to get rid of the red border when a DataGrid cell is invalid?

Rohit Vats
- 79,502
- 12
- 161
- 185
-
1Just for the copy & pasters like me: "ValidatesOnExpcetions" contains a typo. – IngoB Sep 01 '20 at 12:39