How to check whether the text box has validation errrors in .cs file. I have attached validation rule开发者_StackOverflow社区 for the textbox and i display the error message in the UI. Would i be able to check whether a textBox has validation error.
Edited :
I found the answer :
Validation.GetHasError(<textbox instance>)
Validation.HasError attached property is there
http://msdn.microsoft.com/en-us/library/system.windows.controls.validation.haserror.aspx
bool hasError = Validation.GetHasError(txtAttributeName)
精彩评论