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. Image for the cookie policy date

SfListView and SfEffectsView ItemTemplate Issue

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>


1 Reply

GP Gnana Priya Namasivayam Syncfusion Team 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 


Loader.
Live Chat Icon For mobile
Up arrow icon