How to show the busy indicator while loading the data in the UWP DataGrid?
You can show an indication of the data loading with the help of the BusyIndicator while in the UWP DataGrid. You can display the BusyIndicator by setting the BusyIndicator.IsBusy to true when loading the data. Once loaded, you can stop it by setting the BusyIndicator.IsBusy to false by handling the ItemsSourceChanged event of the SfDataGrid.
<Syncfusion:SfBusyIndicator Name="sfBusyIndicator" IsBusy=”True” VerticalAlignment="Center" AnimationType="Gear"> </Syncfusion:SfBusyIndicator>
Here, the BusyIndicator is stopped after the SfDataGrid.ItemsSource is changed by handling the ItemsSourceChanged event.
SfdataGrid.Loaded += SfdataGrid_Loaded; SfdataGrid.ItemsSourceChanged += SfdataGrid_ItemsSourceChanged; async void SfdataGrid_Loaded(object sender, RoutedEventArgs e) { this.SfdataGrid.ItemsSource = await (this.DataContext as ViewModel).GetRecords(); } void SfdataGrid_ItemsSourceChanged(object sender, GridItemsSourceChangedEventArgs e) { sfBusyIndicator.IsBusy = false; }
The following screenshot shows the BusyIndictor before loading the data into the view.
Sample Links:
Conclusion
I hope you enjoyed learning about how to show the busy indicator while loading the data in the SfDataGrid.
You can refer to our UWP DataGrid feature tour page to know about its other groundbreaking feature
representations and documentation, and how
to quickly get started for configuration specifications. You can also
explore our UWP DataGrid example
to
understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal.