Articles in this section
Category / Section

How to display a busy indicator when refreshing the data source asynchronously in Xamarin.Forms DataGrid?

1 min read

An animation can be displayed when refreshing the data source asynchronously by adding an ActivityIndicator inside the layout containing SfDataGrid.

 

Refer the below code example in which an activity indicator is used to display an animation when the grid is refreshed in a button click. If the data model implements the INotifyPropertyChanged interface, then the SfDataGrid responds to the property change in runtime to update the view.

<Button x:Name="refresh_button"
              Text="Refresh"
             />

 

refresh_button.Clicked += Refresh_button_Clicked;
private async void Refresh_button_Clicked(object sender, EventArgs e)
{ 
            ActivityIndicator indicator = new ActivityIndicator();
            indicator.IsRunning = true;
            indicator.IsVisible = true;
            indicator.Color = Color.Black;
            grid.Children.Add(indicator);
            await Task.Delay(3000);
            viewModel.LoadMoreItems();
            indicator.IsRunning = false;
            indicator.IsVisible = false;
}

 

Screenshot

C:\Users\pavithra.sivakumar\AppData\Local\Microsoft\Windows\INetCacheContent.Word\refresh in forms.png

 

Sample Link

How to display a busy indicator when refreshing the data source asynchronously?

 

Conclusion

I hope you enjoyed learning about how to display a busy indicator when refreshing the data source asynchronously in Xamarin.Forms DataGrid.

You can refer to our Xamarin.Forms DataGrid feature tour page to know about its other groundbreaking feature representations. You can also explore our Xamarin.Forms DataGrid documentation 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 forumsDirect-Trac, or feedback portal. We are always happy to assist you!

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