ValidationMode
Input validation happens based on the value of the ValidationMode property. The enum values of this property are
- LostFocus
- KeyPress
When the ValidationMode is KeyPress, the validation is raised for each key press. For LostFocus, the validation take place when the control get lost its focus.
HasError
This read only property is used to check whether the validation succeeds or not. It returns true once validation succeeds or else set to false. The following code example shows the usage of HasError property.
<syncfusion:SfMaskedEdit x:Name="sfMaskedEdit" MaskType="Simple" Mask="00/00/0000" Value="14/11/2014" ValidationMode="LostFocus" LostFocus="sfMaskedEdit_LostFocus"/>
private void sfMaskedEdit_LostFocus(object sender, RoutedEventArgs e)
{
if (sfMaskedEdit.HasError)
{
MessageBox.Show("Please enter the correct date");
}
}
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page