Search code examples
c#androidvisual-studioxamarin.formssyncfusion

Xamarin Forms Syncfusion DataGrid Swipe not working properly


I am using syncfusion datagrid to show data. When I use swipe feature in it to delete a row then row is deleted but delete option still remains there without any row and after that if I add a new row then deleted row remains blank and new row appears after blank row.

My code is:

lstSelectedBookATestViewModel.RemoveAt(swipeRowIndex-1);
dataGrid_Services.ItemsSource = lstSelectedBookATestViewModel;
dataGrid_Services.View.Refresh();

Please help.

Screenshot


Solution

  • You need to reset swipe of DataGrid and no need to rebind data with grid.

     lstSelectedBookATestViewModel.RemoveAt(swipeRowIndex - 1);
     dataGrid_Services.ResetSwipeOffset();
     dataGrid_Services.View.Refresh();