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

sDataGrid Swiping fires SelectedItem

I followed the documentation and sample for swiping on sfdatagrid. I have swiping and selection together and actually when I do swiping, it fires also selecteditem and I normally have a navigation on another page for details of the row when row is selected. how can I control this? how can I prevent selectedItem is fired when swiping left or right?

        <sfgrid:SfDataGrid ScrollingMode="PixelLine" x:Name="dataGrid" 
                           AutoGenerateColumns="False" AllowSorting="True" AllowDraggingColumn="True" AllowDraggingRow="True"
                           ColumnSizer="Star"   MaxSwipeOffset="150"
                            RowHeight="153"   AllowSwiping="True"
                            SwipeEnded="dataGrid_SwipeEnded"
                            SwipeStarted="OnSwipeStart"                
                            Swiping="OnSwiping"
                           GridTapped="dataGrid_GridTapped"
                           SelectionMode="Single"   ItemsSource="{Binding  AllPrograms}"
                           SelectedItem="{Binding SelectedItem}"> 
          <sfgrid:SfDataGrid.LeftSwipeTemplate>
            <DataTemplate>
              <Grid BackgroundColor="#009EDA">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition />
                  <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0"
                       BackgroundColor="Transparent"                      
                       HorizontalOptions="Fill"
                       Source="edit.png">
                  <Image.GestureRecognizers>
                    <TapGestureRecognizer>
                      Command="{Binding OnDELETEClick}"
                      CommandParameter="{Binding .}"
                    </TapGestureRecognizer>
                  </Image.GestureRecognizers>
                </Image>
                <Label Grid.Column="1"
                       BackgroundColor="Transparent"
                       LineBreakMode="NoWrap"
                       Text="DELETE"
                       TextColor="White"
                       HorizontalTextAlignment="Start"
                       VerticalTextAlignment="Center" />
              </Grid>
            </DataTemplate>
          </sfgrid:SfDataGrid.LeftSwipeTemplate>

3 Replies

DS Divakar Subramaniam Syncfusion Team November 7, 2016 11:04 AM UTC

Hi Emil, 
 
 
We have confirmed this as a defect and we are currently working in it. 
 
A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates    
 
Regards, 
Divakar. 



EM Emil July 15, 2017 11:56 PM UTC

Hi,

this problem is fixed for sfDatagrid but happening for sfListView also. I am not sure if I should have another ticket for that. can you please check it? thanks,

Emil



AN Ashok N Syncfusion Team July 17, 2017 09:26 AM UTC

Hi Emil,  
  
Sorry for the inconvenience caused.  
  
We have checked the reported issue “Selection events get triggered when swiping is performed in SfListView” at our end by enabling both AllowSwiping as “Single” and SelectionMode as Multiple with the latest SfListView version(v 15.2.0.46). In the sample, we have loaded the SfListView in theMasterDetailPage and enabled the swiping and selection and performed swipe gesture action in both left and right swipe direction and no selection events get triggered as reported and it works as expected at our end. For your reference, we have attached the ensured sample at our end and you can download it from the below link.  
  
  
Could you please check with the above sample? If the issue still persists at your end, we request you to modify the above sample to reproduce the issue with the replication procedure and also, could you please share the below details which would help us to analyze the issue better and update you an appropriate solution.  
  
Could you please share the Xamarin Forms version?. We have ensured in Xamarin Forms v 2.3.4.231. 
Could you please share the SfListView version?. We have ensured in latest version (v 15.2.0.46). 
Could you please share which layout is defined in LayoutManager such as Linear or Grid Layout? 
  
Please let us know if you require further assistance.  
  
Regards,  
Ashok 


Loader.
Live Chat Icon For mobile
Up arrow icon