SfDatagrid Load More view disappearing permanently after first click.

Hi,

This is the code we are using for the data grid

XAML:
<syncfusion:SfDataGrid x:Name="gridMarker"
                                   Grid.Row="3"
                                   GridStyle="{StaticResource SSXGridStyle}"
                                   HorizontalOptions="Fill" VerticalOptions="Fill"
                                   ItemsSource="{Binding MarkerItemSource}"
                                   AutoGenerateColumns="True"
                                   ColumnSizer="Auto"
                                   SelectionMode="SingleDeselect"
                                   AllowSorting="True"
                                   AllowTriStateSorting="True"
                                   BackgroundColor="#EBEBEB"
                                   LoadMoreCommand="{Binding LoadMoreCommand}"
                                   AllowLoadMore="True"
                                   SelectedItem="{Binding SMarker, Mode=TwoWay}">
            </syncfusion:SfDataGrid>

View Model:
public async void OnLoadMoreCommand()
        {
            try
            {
                var lstMarkers = await _markerInvestigationService.GetMarkerInvestigation(SWBSNodeInfo.SelectedWBSNode.WBSNodeGuid, ++_pageNo, 20);
                foreach (var marker in lstMarkers)
                    MarkerItemSource.Add(marker);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }

Note : The datagrid is binded to MarkerItemSource which is an observable collection.

The issue we are facing is after the first click on the Load More View  the next set of data gets added to the grid but then the load more view disappears permanently and does not appear once the grid is scrolled to the bottom. Please help.

Thanks in advance!

2 Replies

VR Vigneshkumar Ramasamy Syncfusion Team October 8, 2018 01:05 PM UTC

Hi IT Operations 
 
We were able to reproduce the reported issue in our side and we have logged a bug report for the issue. We will fix the issue and included in our upcoming 2018 Volume 3 Service Pack 1 release which is scheduled to be rolled out by the end of October 2018. We appreciate your patience until then.   
   
Regards,  
Vigneshkumar R 



VR Vigneshkumar Ramasamy Syncfusion Team October 9, 2018 12:19 PM UTC

Hi IT Operations,  
 
Sorry for the inconvenience caused.   
 
It is the sample level issue, you need to set the SfDataGrid.IsBusy as true, when loading the items to SfDataGrid and reset SfDataGrid.IsBusy as false after adding the items.   
 
Please find the code snippet of the same below.  
 
  
//MainPage.xaml  
<ContentPage.BindingContext>  
    <local:ViewModel x:Name="viewModel" />  
  </ContentPage.BindingContext>  
  <ContentPage.Content>  
    <sfgrid:SfDataGrid x:Name="sfGrid"  
             AutoGenerateColumns="False"  
             ItemsSource="{Binding OrdersInfo}"  
             AllowResizingColumn="True"  
             ColumnSizer="Star"  
             AllowLoadMore="True"  
             LoadMoreCommand="{Binding LoadMore}"  
             IsBusy="{Binding Busy}"  
                 >  
      <sfgrid:SfDataGrid.Columns>  
        <sfgrid:GridTextColumn MappingName="OrderID" />  
        <sfgrid:GridTextColumn MappingName="EmployeeID" />  
        <sfgrid:GridTextColumn MappingName="CustomerID" />  
        <sfgrid:GridTextColumn MappingName="ShipCountry" HeaderText="Country"/>  
      </sfgrid:SfDataGrid.Columns>  
    </sfgrid:SfDataGrid>  
  </ContentPage.Content>  
 
public class ViewModel : NotificationObject  
{  
    private bool busy;  
    public bool Busy  
    {  
        get  
        {  
            return busy;  
        }  
  
        set  
        {  
            busy = value;  
            RaisePropertyChanged("Busy");  
        }  
    }  
    public ViewModel()  
    {  
        order = new OrderInfoRepository();  
        LoadMore = new Command(LoadMoreItems);  
        SetRowstoGenerate(50);  
    }  
   private async void LoadMoreItems()  
    {  
        this.Busy = true;  
        await Task.Delay(new TimeSpan(0, 0, 5));  
        for (int i = 0; i < 20; i++)  
            this.OrdersInfo.Add(order.GenerateOrder(OrdersInfo.Count + 1));  
        this.Busy = false;  
    }  
}  
 
We have prepared the sample as per your requirement, you can download it from the below link.   
 
Regards,  
Vigneshkumar R 


Loader.
Up arrow icon