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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Show loading indicator when datagrid is first being populated MVVMCross 6.3.0

Thread ID:

Created:

Updated:

Platform:

Replies:

145151 Jun 10,2019 09:54 AM UTC Jul 30,2019 09:53 AM UTC Xamarin.Forms 7
loading
Tags: SfPullToRefresh
bgaprogrammer
Asked On June 10, 2019 09:54 AM UTC

Hello,

I have a xaml page containing a DataGrid inside a PullToRefresh control (same way you showed me in another thread)

That sample is working fine but now I'm facing the need to show a loading indicator when the grid is being populated the first time, here I tried just adding a binding to the IsRefreshing property of the SfBusyIndicator and set it to true/false in the Initialize event of MVVMCross, unfortunately it does not work.

Could you please guide me to get this working?

PD. Please attach a sample

Subburaj Pandian Veluchamy [Syncfusion]
Replied On June 11, 2019 12:57 PM UTC

Hi Jorge, 
  
Thank you for contacting Syncfusion support. 
  
We have checked your query, you can load SfBusyIndicator while SfDataGrid has been loading. To show SfBusyIndicator during loading of SfDataGrid, you need to set SfBusyIndicator.IsBusy property to true in the SfDataGrid.GridLoaded event. You can set SfBusyIndicator.IsBusy property to false based on the required loading time. 
  
Please refer the following code, 
 
[C#]  
private async void DataGrid_GridLoaded(object sender, GridLoadedEventArgs e) 
{ 
               indicator.IsBusy = true; 
               indicator.IsVisible = true; 
               indicator.AnimationType = AnimationTypes.SlicedCircle; 
               grid.Children.Add(indicator); 
               await Task.Delay(200); 
               indicator.IsBusy = false; 
               indicator.IsVisible = false; 
} 
  
We have prepared a sample based on your requirement, 
 
 
We hope this helps. Please lets us know, if you have any query. 
 
Regards,
Subburaj Pandian V  


bgaprogrammer
Replied On June 13, 2019 12:31 PM UTC

Hello,

The provided sample dont work on iOS because you forgot to initialize the renderers.

Despite that, I'm wondering why are you using a Task.Delay instead of a proper way to show/hide the indicator when the real data is loaded from server? The time will always depend on the user's network speed so one can't simply "guess" a time to delay the app...

Subburaj Pandian Veluchamy [Syncfusion]
Replied On June 14, 2019 12:52 PM UTC

Hi Jorge, 
  
Thank you for your update. 
  
We have checked your query and you can achieve your requirement by using Incremental Loading. We have prepared and attached the sample based on your requirement. In the sample, we have use IncrementalList to set the ItemsSource.  
 
You can download the same from the following link. 
  
 
We hope it helps. Please revert us for further assistance. 
 
Regards,
Subburaj Pandian V  


bgaprogrammer
Replied On July 28, 2019 07:35 PM UTC

Hello,

The provided code dont work.

As I mentioned in my initial post, my DataGrid is inside a PullToRefresh control, the provided code dont work in this scenario.

Shivagurunathan Kamalakannan [Syncfusion]
Replied On July 29, 2019 02:00 PM UTC

Hi Jorge, 
 
Thank you for the update. 
 
To show the refreshing indicator at the sample level we had given delay to it. Yes that the data that are fetched from the networks has different timing. In your case if you fetch the data asynchronously, you can set the itemsSource for the DataGrid in the loaded event itself as it will be fired at the time of loading only. And so, you need not give delay for it. 
 
We had prepared a sample for your reference and you can download it from the below link. 
 
Regards, 
Shivagurunathan 


bgaprogrammer
Replied On July 29, 2019 02:11 PM UTC

Hello,

The provided sample do not match my scenario, as the title of this thread says, I'm using MVVMCross 6.3.0. To perform the suggested solution I will need to create a Behavior and there is no documentation about it.

Please if you suggest something make it work on the scenario I'm mentioning.

Subburaj Pandian Veluchamy [Syncfusion]
Replied On July 30, 2019 09:53 AM UTC

Hi Jorge, 
 
Thank you for the update. 
 
We have prepared a sample in MvvmCross. As mentioned earlier you can set the itemSource in the loaded event itself as it will be fired at the time of loading only. 
 

We hope this helps. Please let us know, if you would require any further assistance. 
 
Regards,
Subburaj Pandian V    
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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
Live Chat Icon