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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to close LeftSwipe on DataGrid selected row change

Thread ID:





130310 May 5,2017 12:01 PM UTC May 8,2017 11:38 AM UTC Xamarin.Forms 1
Tags: SfDataGrid
Asked On May 6, 2017 03:07 AM UTC

Hi,May I know the best way to close the LeftSwipeTemplate on DataGrid's programatically? Usecase: I select one row and swipe to edit it.Then I select another record (selected row changed by using TapGestureRecognizer). Now I don't want to leave the LeftSwipe view open. I want to close it. I couldn't find anyway to close it.I have just one column in my DataGrid and it is a GridTemplateColumn type. When you implement TapGestureRecognizer the default SwipeView close functionality not working anymore. So, I have to close the SwipeView programmatically.Thanks!                                                                                                                                                                                       

Sivaraman Sivagurunathan [Syncfusion]
Replied On May 8, 2017 11:38 AM UTC

Hi Charith, 
Thanks for using Syncfusion products. 
We have checked your query. SfDataGrid will not handle touch operations, if its child view has already handled and taken over the touch. This is because the child view suppresses the parent's touch and since you are using TapGestureRecognizer inside template column, this suppresses the touch of SfDataGrid which is why the swipe view was not collapsed on tap. However, you can programmatically close the swipe view in SfDataGrid using SfDataGrid.ResetSwipeOffset() method. 
The below code example illustrates how to close the swipe view programmatically.    
private void Btn_Clicked(object sender, EventArgs e)   



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon