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.

Single and Double taps

Thread ID:

Created:

Updated:

Platform:

Replies:

129948 Apr 11,2017 09:29 AM Apr 13,2017 05:01 AM Xamarin.iOS 5
loading
Tags: SfDataGrid
Clint Anderson
Asked On April 11, 2017 09:29 AM

I have a grid that needs both single tap and double tap interaction.  Either of them works fine by itself, but if I try to add both of them, single tap always steals the interaction and double tap never gets called.

grid.GridTapped += Grid_GridTapped;
grid.GridDoubleTapped += Grid_GridDoubleTapped;
  //never gets called

Sivaraman Sivagurunathan [Syncfusion]
Replied On April 12, 2017 01:40 PM

Hi Clint Anderson,

Thanks for contacting Syncfusion Support.

We have analyzed your query, and we are unable to reproduce the issue at our end. We were able to fire the GridDoubleTapped event inspite of hooking the GridTapped event. It is the default behavior that single tap gets invoked when performing a double tap. But double tap gets called after single tap is called. Hence please share your code snippets or sample replicating the issue with clear replication procedure.

Regards,
Sivaraman

 


Sivaraman Sivagurunathan [Syncfusion]
Replied On April 12, 2017 01:40 PM

Hi Clint Anderson,

Thanks for contacting Syncfusion Support.

We have analyzed your query, and we are unable to reproduce the issue at our end. We were able to fire the GridDoubleTapped event inspite of hooking the GridTapped event. It is the default behavior that single tap gets invoked when performing a double tap. But double tap gets called after single tap is called. Hence please share your code snippets or sample replicating the issue with clear replication procedure.

Regards,
Sivaraman

 


Sivaraman Sivagurunathan [Syncfusion]
Replied On April 12, 2017 01:40 PM

Hi Clint Anderson,

Thanks for contacting Syncfusion Support.

We have analyzed your query, and we are unable to reproduce the issue at our end. We were able to fire the GridDoubleTapped event inspite of hooking the GridTapped event. It is the default behavior that single tap gets invoked when performing a double tap. But double tap gets called after single tap is called. Hence please share your code snippets or sample replicating the issue with clear replication procedure.

Regards,
Sivaraman

 


Clint Anderson
Replied On April 12, 2017 01:45 PM

It appears that due to some transformations in the single tap, and some null checks in the double tap I mistakenly thought that my double tap was not getting called.

Is there a way to detect a double tap from within the single tap method so that I know not to execute that code if it was a double tap?

Divakar Subramaniam [Syncfusion]
Replied On April 13, 2017 05:01 AM

Hi Clint Anderson, 
 
 
Yes. You can check/detect the double tap in single tap event as you required. Please refer the below code snippet. 
 
 
//Variable to check whether the double tab event is triggered or not. 
private bool isDoubleTapped; 
 
private void DataGrid_GridDoubleTapped(object sender, GridDoubleTappedEventsArgs e) 
{ 
    isDoubleTapped = true; 
} 
 
private async void DataGrid_GridTapped(object sender, GridTappedEventsArgs e) 
{ 
    //do your code here if any.. 
    await Task.Delay(2000); 
 
    if (isDoubleTapped) 
    { 
        //if double tap is listened, this block will hit. you can do your codes here. 
    } 
    isDoubleTapped = false; 
} 
  
 
In the above code, we have delayed the further process in GridTapped event once you tap the grid. So, the GridDoubleTapped event will be fired even before the completion of GridTapped event. Hence, you can detect the GridDoubleTapped event in GridTaped event itself. 
 
 
We have prepared a simple sample for your reference and you can download the same from the below link. 
 
 
 
Regards, 
Divakar.  


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.

;