Hi
Fardin,
You can achieve your requirement to show the busy indicator with
OnDemandLoading on MVVM pattern will be achieved using the below code snippet,
|
AssociatedObject.sfDataPager.OnDemandLoading
+= OnDemandLoading;
async void OnDemandLoading(object sender, OnDemandLoadingEventArgs
args)
{
AssociatedObject.busyIndicator.IsBusy = true;
await Task.Delay(5000);
AssociatedObject.sfDataPager.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.ApplicationIdle,
new Action(() =>
{
AssociatedObject.sfDataPager.LoadDynamicItems(args.StartIndex,
source.Skip(args.StartIndex).Take(args.PageSize));
AssociatedObject.dataGrid.View.Refresh();
AssociatedObject.busyIndicator.IsBusy
= false;
}));
}
|
For more information related to DataVirtualization and showing busy indicators,
please refer the below user guide documentation link,
UG Link: https://help.syncfusion.com/wpf/datagrid/data-virtualization
KB Link: https://www.syncfusion.com/kb/5352/how-to-show-the-busy-indicator-while-loading-the-data-in-the-sfdatagrid
Please find the sample in the attachment and let us know if you have any
concerns about this.
Regards,
Dhanasekar M.
Attachment:
Sample_51a1a643.zip