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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfListView and SfEffectsView ItemTemplate Issue

Thread ID:

Created:

Updated:

Platform:

Replies:

149474 Nov 27,2019 08:29 AM UTC Nov 28,2019 11:59 AM UTC Xamarin.Forms 1
loading
Tags: SfListView
Alex
Asked On November 27, 2019 08:29 AM UTC

I'm using the latest version (17.3.0.29) and I'm trying to use SfEffectsView with SfListView ItemTemplate. Unfortunately, while it shows an effect, SfListViewTapCommand not firing. Please support.

 <listview:SfListView.ItemTemplate>
   <DataTemplate>
       <syncEffectsView:SfEffectsView  BackgroundColor="{StaticResource Primary}"
         x:Name="itemEffect" 
         TouchDownEffects="Ripple"
         RippleColor="{StaticResource PrimaryLight}" 
Padding="0"  
Margin="5,1,5,1">  
         <Grid Padding="5">
               <Grid.RowDefinitions>
  <RowDefinition Height="Auto" />
  <RowDefinition Height="Auto" />
               </Grid.RowDefinitions>
               <Grid.ColumnDefinitions>
  <ColumnDefinition Width="Auto" />
  <ColumnDefinition Width="1*" />
               </Grid.ColumnDefinitions>
          </Grid> 
       </syncEffectsView:SfEffectsView>
   </DataTemplate>
 </listview:SfListView.ItemTemplate>


Gnana Priya Namasivayam [Syncfusion]
Replied On November 28, 2019 11:59 AM UTC

Hi Alex, 
 
Sorry for the inconvenience caused. 
 
We would like to inform you that as per the current behavior of EffectsView touch will pass to the view and it won't return to the parent. Because of this case in Android, ListView ItemTapped Command not working. Also, we should not handle ShouldIgnoreTouches to pass touch to the parent, since it required for EffectsView. We wrongly mentioned you to use the same in our last update. If your requirement is to Ripple while selection you can achieve the same by enabling the Visual as Material as in the following Case1. 

If your requirement to handle the selection with the combination you can use SfEffectsView and use it
 
SelectionChanged event instead of handling in ListView TapCommand as in the following case 2.

Please refer the following code,
 
  
Case1: 
<ContentPage xmlns:local="clr-namespace:SortingFiltering" Visual="Material" 
             xmlns:syncEffectsView="clr-namespace:Syncfusion.XForms.EffectsView;assembly=Syncfusion.Core.XForms" 
             xmlns:sync="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms"> 
  
Case2: 
  
Xaml: 
<sync:SfListView.ItemTemplate> 
     <DataTemplate x:Name="ItemTemplate"> 
         <syncEffectsView:SfEffectsView  BackgroundColor="LightGreen"  
              x:Name="itemEffect"  SelectionChanged="ItemEffect_SelectionChanged"> 
         </syncEffectsView:SfEffectsView> 
     </DataTemplate> 
</sync:SfListView.ItemTemplate> 
  
CodeBehind: 
  
public partial class MainPage : ContentPage 
{ 
  
   private void ItemEffect_SelectionChanged(object sender, EventArgs e) 
   { 
     // You can handle selection changed events instead TapCommand 
   } 
} 
  
We have attached the sample for your reference, please find it from the following link. 
  
 
We hope this helps. Please let us know if you need any further assistance. 
  
Regards, 
Gnana Priya N 


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.

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

Live Chat Icon For mobile
Live Chat Icon