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
close icon

Show loading indicator when datagrid is first being populated MVVMCross 6.3.0

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

7 Replies

SP Subburaj Pandian Veluchamy Syncfusion Team 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  



BG bgaprogrammer 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...


SP Subburaj Pandian Veluchamy Syncfusion Team 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  



BG bgaprogrammer 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.


SK Shivagurunathan Kamalakannan Syncfusion Team 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 



BG bgaprogrammer 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.


SP Subburaj Pandian Veluchamy Syncfusion Team 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    
 


Loader.
Live Chat Icon For mobile
Up arrow icon