How to use BusyIndicator along with OnDemandLoading?

Please give an example code that uses OnDemandLoading and shows BusyIndicator while data are loaded. I want to use MVVM pattern.

Thanks


3 Replies

DM Dhanasekar Mohanraj Syncfusion Team July 22, 2022 04:37 PM UTC

Hi Fardin,


Currently, we are checking the feasibilities to achieve your requirement. We need two more business days to check this. We will update you with further details on July 26, 2022.

We appreciate your patience until then.


Regards,

Dhanasekar M.



DM Dhanasekar Mohanraj Syncfusion Team July 26, 2022 03:50 PM UTC

Hi Fardin,

Sorry for the inconvenience caused.

Still, we are working on this.
We will check and update you on further details on July 28, 2022.

We appreciate your patience until then.

Regards,
Dhanasekar M.



DM Dhanasekar Mohanraj Syncfusion Team July 28, 2022 03:46 PM UTC

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

Loader.
Up arrow icon