We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Using INotifyDataErrorInfo

Hello, I am trying to build a user input validation strategy using Syncfusion input controls for LOB Applications.
Is it possible to use the INotifyDataErrorInfo with Syncfusion Input controls and if yes can you provide one or more examples of using it
Thank you in advance
Best regards
Panikos Frangoudes

1 Reply

MK Muneesh Kumar G Syncfusion Team October 30, 2018 12:25 PM UTC

Hi Frangoudes, 
 
Thanks for using Syncfusion products.  
 
We have analyzed your requirement and we would like to inform you that by default data validation available in SfTextBox itself. Please find the code snippet for this.  
 
Code snippet 
 protected override IEnumerable<DataValidationError> GetPropertyErrors(
            string propertyName, object value)
        {
            var result = new List<DataValidationError>();
 
  
            switch (propertyName)
            {
                case nameof(TextField1):
                    
                            //Place your validation here
                    
                    break;
            }
 
  
            return result;
        }
 
 
 
We have prepared a sample for using the IEnumerable <DatavalidationError>.In this we can perform error validation by using the following codes 
 
 
In this sample we have perform error validation for two SfTextBox, one for validate entry size and another one for check text is “foo”. 
 
 
Please let us know if you have any queries.  
 
Regards, 
Muneesh Kumar G. 


Loader.
Live Chat Icon For mobile
Up arrow icon