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.
Unfortunately, activation email could not send to your email. Please try again.

How to close LeftSwipe on DataGrid selected row change

Thread ID:

Created:

Updated:

Platform:

Replies:

130310 May 5,2017 08:01 AM May 8,2017 07:38 AM Xamarin.Forms 1
loading
Tags: SfDataGrid
Charith
Asked On May 5, 2017 11:07 PM

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 07:38 AM

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)   
{   
    dataGrid.ResetSwipeOffset();   
}   
  
Regards,

Sivaraman  
 


CONFIRMATION

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.

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.

;