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