Articles in this section
Category / Section

How to validate SfDataForm on page loading ?

1 min read

You can validate the SfDataForm on page being appearing by using the Validate method available in SfDataForm inside the Device.BeginInvokeOnMainThread which allows to force, to update the UI on the main thread by listening the Appearing event of Page using Behavior (if MVVM), or OnAppearing override method of page.

 

Please find the code example.

 

protected override void OnAppearing()
{ 
           base.OnAppearing();
           Device.BeginInvokeOnMainThread
            (() =>            {
                this.dataForm.Validate();
            });
}

 

 

You can download the source code for this demo of applying validation in initial time of loading from here, DataFormSample

 

 

../Desktop/Xamarin%20assemblies/DataForm_Validation.jpg

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied