We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Platform: Xamarin.iOS |
Control: SfDataGrid
Tags: general

An animation can be displayed when refreshing the data source asynchronously by adding an UIActivityIndicatorView in the view.

Refer the below code example in which an UIActivityIndicatorView is used to display an animation when the grid is refreshed in a button click.

public MyViewController()


   sfDataGrid = new SfDataGrid();

   viewModel = new ViewModel();

   sfDataGrid.ItemsSource = viewModel.OrdersInfo;

   activityIndicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);

   refresh_button = new UIButton();

   refresh_button.TouchUpInside += Refresh_button_TouchUpInside;

   refresh_button.SetTitle ( "Refresh",UIControlState.Normal);





   View.BackgroundColor = UIColor.White ;



private async void Refresh_button_TouchUpInside(object sender, EventArgs e)


     activityIndicator.Frame = new CoreGraphics.CGRect(0, 50, this.View.Frame.Width, this.View.Frame.Height);


     await Task.Delay(new TimeSpan(0, 0, 3));





Note: If the data source implements ICollectionChanged interface, then SfDataGrid will automatically refresh the view when an item is added, removed or cleared. If the data model implements the INotifyPropertyChanged interface, then the SfDataGrid responds to the property change in runtime to update the view.


                C:\Users\pavithra.sivakumar\AppData\Local\Microsoft\Windows\INetCacheContent.Word\refreshin ios.png


Sample Link

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

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile