Swiping

Overview

The SfListView allows swiping items to do custom actions such as deleting the data, adding the data, editing the data, etc. To enable swiping, set the SfListView.AllowSwiping property to true. Swipe views are displayed when swiping from left to right or right to left (for horizontal orientation, top to bottom or bottom to top) on the item.

It provides customizable swipe templates for swiping on left and right sides. You can restrict the layout of swipe view up to a certain position when swiping the item by setting the SfListView.SwipeThreshold property. You can set size of the swipe views by setting the SfListView.SwipeOffset property.

NOTE

When SfListView.AutoFitMode is AutoFitMode.Height for main listview, the height of inner listview will change while scrolling the view and items will be refreshed.

SwipeReset Event

The SfListView.SwipeReset event is fired when swiping gets reset. The SwipeReset action can be canceled by setting the Cancel property of the ResetSwipeEventArgs to true. This event is triggered with ResetSwipeEventArgs.

SwipeReset event provides the following properties in their arguments:

Limitations

When ListView is loaded in CarouselView with SfListView.AllowSwiping as false, it behaves in UWP platform as follows:

While performing first swipe on the view, it will be handled by ScrollView to ensure whether scrolling is happened or not. If not means the manipulation to parent cannot be passed immediately due to UWP platform behavior. The second swipe will be listened by CarouselView, and the view gets swiped. This is the behavior of the SfListView.

When ListView is loaded in CarouselView with AllowSwiping as true, it behaves as follows:

When swiping in iOS, suddenly carousel swipe happened. To swipe ListViewItem, touch and hold the item for some fraction of seconds (0.25 - 0.5 seconds) and then swipe.

When swiping any Item, the SfListView handles the touch and swipe the ListViewItem.

After swiping on ListViewItem, SwipeView will load along with it. If you swipe SwipeView element, Carousel view is swiped. Or else swipe on ListViewItem, control handles touching and swiping the item as usual.

If you swipe header, footer, or group header elements, Carousel view will swipe in Android platform. But in UWP, first swipe on those elements will be handled by SfListView itself, because manipulation to parent cannot be passed immediately. The second swipe will be listened by CarouselView.

When ListView is loaded in MasterDetailPage with AllowSwiping as true, it behaves as follows:

In iOS platform, when swiping a ListViewItem, touch and hold the item for some fraction of seconds (0.25 - 0.5 seconds) and then swipe.

When ListView ItemTemplate contains button with AllowSwiping as true, it behaves as follows:

While swiping in Android and UWP, button click event executes after swiping.

While swiping in iOS, swipe action does not happened when clicking and swiping a button.

Swiping will be reset whenever the listview is refreshed like scrolling or any size change is made.