Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Grid Double Tapped Function Add (my source) #76

Open
daesang opened this issue Mar 29, 2018 · 0 comments
Open

Grid Double Tapped Function Add (my source) #76

daesang opened this issue Mar 29, 2018 · 0 comments

Comments

@daesang
Copy link

daesang commented Mar 29, 2018

Xamarin Forms SyncFusion DataGrid Component in GridDoubleTapped Function .

same function
https://help.syncfusion.com/xamarin/sfdatagrid/grid-events#griddoubletapped-event

my source......

Xamarin.Forms.DataGrid-master\Xamarin.Forms.DataGrid\DataGrid.xaml.cs

//2018.03.29, [email protected], Double Tap Function Add.
public event EventHandler ItemDoubleTapped;

public DataGrid(ListViewCachingStrategy cachingStrategy)
{
.....
//2018.03.29, [email protected], Double Tap Function Add.
_listView.ItemTapped += (s, e) =>
{
DataGrid_ItemTapped(s, e);
};
}

//2018.03.29, [email protected], Double Tap Function Add.
private int selectedCount = 0;
private ItemTappedEventArgs itemTappedEventArgs;
private void DataGrid_ItemTapped(object sender, ItemTappedEventArgs e)
{
if (this.itemTappedEventArgs != null && e != null && this.itemTappedEventArgs.Item == e.Item)
{
this.selectedCount += 1;
if (selectedCount == 2)
{
System.Diagnostics.Debug.WriteLine("Grid Double Tapped");
ItemDoubleTapped?.Invoke(sender, e);
selectedCount = 0;
}
}
else
{
this.itemTappedEventArgs = e;
selectedCount = 1;
}
}

Xamarin.Forms.DataGrid-master\DataGridSample\DataGridSample\Views\MainPage.xaml

<dg:DataGrid ItemsSource="{Binding Teams}"
SelectionEnabled="True"
SelectedItem="{Binding SelectedTeam}"

		 ItemDoubleTapped="DataGrid_ItemDoubleTapped"                     
		 
		 RowHeight="70" 
		 HeaderHeight="50" 
		 BorderColor="#CCCCCC" 
		 HeaderBackground="#E0E6F8"
		 ActiveRowColor="#8899AA">

Xamarin.Forms.DataGrid-master\DataGridSample\DataGridSample\Views\MainPage.xaml.cs

private void DataGrid_ItemDoubleTapped(object sender, ItemTappedEventArgs e)
{
Debug.WriteLine("Grid Double Tapped");
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant