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

Event draw items completed

Hi, there any event handler that is fired when the datasource are completed or items is drawed in SFDataGrid in Xamarin.Forms?

ex: 

Grid.ItemsAddedCompleted +=... 

or 

Grid.EndDrawItemsCompleted +=...




3 Replies

SP Subburaj Pandian Veluchamy Syncfusion Team June 27, 2019 12:57 PM UTC

Hi Rafael, 
  
Thank you contacting Syncfusion support. 
  
You can use ItemsSourceChanged event which fires whenever the ItemsSource has been changed. Please refer our User Guide documentation regarding the same, 
 
  
Please refer the following code snippet, 
  
  
public MainPage() 
{ 
    InitializeComponent();                                             
    dataGrid.ItemsSourceChanged += DataGrid_ItemsSourceChanged; 
} 
  
private void DataGrid_ItemsSourceChanged(object sender, GridItemsSourceChangedEventArgs e) 
{ 
    //// You can do required process here. 
}  
  
We have prepared a sample based on your requirement and you can download it from the below link. 
 
  
We hope this helps. Please let us know, if you would require any further assistance. 
  
Regards,
Subburaj Pandian V  



RF RAFAEL FELIPE SACOMANI June 27, 2019 05:14 PM UTC

this event is fired when start the datasource changed or end? 

i ask this because i want to use a loading screen and hide this only when the grid are fully loaded


SP Subburaj Pandian Veluchamy Syncfusion Team June 28, 2019 10:25 AM UTC

Hi Rafael, 
  
Thank you for the update. 
  
Your requirement to load a loading indicator while SfDataGrid has been loaded, can be achieved by loading a SfBusyIndicator in the SfDataGrid.GridLoaded event. 
   
Please refer the following code for the same, 
  
 [C#] 
public partial class MainPage : ContentPage 
    SfBusyIndicator indicator; 
    public MainPage() 
    { 
        InitializeComponent(); 
        indicator = new SfBusyIndicator(); 
                              dataGrid.GridLoaded += DataGrid_GridLoaded;             
    } 
  
               private async void DataGrid_GridLoaded(object sender, GridLoadedEventArgs e) 
               { 
                              //// customize based on the requirement.        
                              indicator.IsBusy = true; 
                              indicator.IsVisible = true; 
                              indicator.AnimationType = AnimationTypes.SlicedCircle; 
                              grid.Children.Add(indicator); 
                              await Task.Delay(2000); 
                              indicator.IsBusy = false; 
                              indicator.IsVisible = false; 
               }              
}   
 
  
You can refer our User Guide documentation regarding the same by the following link, 
 
 
We have prepared a sample based on your requirement and you can download it from the below link, 
 
  
Regards,
Subburaj Pandian V  


Loader.
Up arrow icon