Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get rid of the textbox validation border

How to get rid of the red border around textbox automatically used for validation purposes?

like image 241
Ondrej Janacek Avatar asked Oct 09 '11 13:10

Ondrej Janacek


2 Answers

Easiest way to do this:

<TextBox Validation.ErrorTemplate="{x:Null}">
like image 192
BlueM Avatar answered Sep 24 '22 22:09

BlueM


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?

like image 22
Rohit Vats Avatar answered Sep 23 '22 22:09

Rohit Vats