Disabled Start Swipe

Hi, I have a listview with StartSwipe and LeftSwipe, but for some users with no permisssions, I want to disabled the start Swipe and maintain the EndSwipe.


I've tried with SwipeStarting event, but if I fast swipe when end is visible it shows the start.


How can I do that???

Thank you



1 Reply

RM RiyasHameed MohamedAbdulKhader Syncfusion Team September 26, 2023 12:42 PM UTC

Hi Helder,

We have reviewed your reported query and suspect that you might be swiping from left to right and then from right to left without releasing your finger. In this scenario, the 'swipe started' event may not trigger, and consequently, the start swipe will not disable. To overcome this, we recommend restricting the swipe action during the swiping event by setting 'e.handled' to 'true.' We have attached a code snippet and a sample for your reference.

Code snippet

private void listView_SwipeStarting(object sender, Syncfusion.Maui.ListView.SwipeStartingEventArgs e)

{

       if (e.Direction == SwipeDirection.Right)

       {

             e.Cancel = true;

       }

}

private void listView_Swiping(object sender, Syncfusion.Maui.ListView.SwipingEventArgs e)

{

       if(e.Direction == SwipeDirection.Right)

       {

             e.Handled = true;

       }

}


Regards,
Riyas Hameed M



Attachment: ListViewSwipe_76a4bf56.zip

Loader.
Up arrow icon