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

binding the value of HasError

Validation working so fine but the border of SfTextInputLayout still red even if the errors are gone when I set HasErro property to true,
How can I bind HasErro's value to my validation in ViewModel?, can you give an example please?

6 Replies

DV Divya Venkatesan Syncfusion Team January 10, 2020 01:00 PM UTC

Hi Aboubaker, 
 
Greetings from Syncfusion. 
 
We have prepared a sample to validate Email id. Please download the sample from the below link. 
 
 
Please let us know if you need any further assistance. 
 
Regards, 
Divya Venkatesan 



AB Aboubaker January 10, 2020 03:41 PM UTC

OMG, thank you so much, so the converter did the work..
The way you bound HasErro is so brilliant.

By the way I tested many other products but SyncFusion is the best, keep up.



DV Divya Venkatesan Syncfusion Team January 13, 2020 06:41 AM UTC

Hi Aboubaker, 
 
Thanks for your appreciation. 
 
Please get back to us if you need any further assistance. We would be happy to assist you. 
 
Regards, 
Divya Venkatesan 



EA Eduardo Arruda replied to Divya Venkatesan February 7, 2021 01:38 AM UTC

Hi Aboubaker, 
 
Greetings from Syncfusion. 
 
We have prepared a sample to validate Email id. Please download the sample from the below link. 
 
 
Please let us know if you need any further assistance. 
 
Regards, 
Divya Venkatesan 


It would much better if I could only bind the HasError value, such as:

       
       
            x:Name="emailInputLayout"
            Grid.Row="3"
            HelperText="Enter your email address"
            Hint="Email" 
            HasError="{Binding isEmailWithError}" >

           
       
            

           
       

I cannot make the above work.
If bool isEmailWithError is True it has error and if false there is no error. 

Is possible to bind this way? 


EA Eduardo Arruda February 7, 2021 01:39 AM UTC

Sorry,

My approach is working. 
I forgot to set INotifyPropertyChanged on isEmailWithError.

Thank you.


SS Sridevi Sivakumar Syncfusion Team February 9, 2021 05:35 AM UTC

Hi Eduardo Arruda,

Thanks for your update.

Let us know if you need any further assistance.

Regards,
Sridevi S. 


Loader.
Live Chat Icon For mobile
Up arrow icon