Hi Kenney,
Thanks for contacting Syncfusion support.
Query: “ How do I keep my custom validation message without it overriding my default validation rules?”
We have analyzed the reported query and we understand that perform default validation on other column when Custom Validator component is defined to validate the duplicate email. We would like to inform you that when Custom Validator Component is defined inside the Validator of GridEditSettings, default validation will not work. Because in the custom validator component, we have override the HandleValidation method of Validator component and performed validation for Email column. So that method (Handle Validation) only will be triggered when validating the value of other columns as well.
So we request you to handle the validation for other column as well in you validator component to achieve your requirement. Please get back to us if you have further queries.
Query2: “How do I make the custom validation message go away when it's condition has been satisfied?”
We are able to reproduce the reported behavior at our end while preparing a sample using your code example. In your Validator component you have only cleared the validation message store. Hence the reported issue has occurred. Once the validation gets success, we request you to call ShowValidationMessage of the context with true value like below
Refer the below code example
|
protected void HandleValidation(FieldIdentifier identifier)
{
if (identifier.FieldName.Equals("Email"))
{
messageStore.Clear(identifier);
. . . . . . .
else
{
messageStore.Clear(identifier);
context.ShowValidationMessage("Email", true, null);
}
}
}
|
For your convenience we have prepared a sample using the above code example which can be downloaded from below
Refer to our UG documentation for your reference
Please get back to us if you have further queries.
Regards,
Vignesh Natarajan