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

Swype gets wrong index values after enable grouping.

Thread ID:

Created:

Updated:

Platform:

Replies:

149292 Nov 20,2019 09:35 PM UTC Nov 21,2019 11:58 AM UTC Xamarin.Forms 1
loading
Tags: SfListView
Leopoldo
Asked On November 20, 2019 09:35 PM UTC

Hello,

Initially SfListView is working fine and swipe returns the correct index for the swiped register.

But, after setup same code to use grouping in order SfListView shows items organized by category, then swipe returns wrong values for the swiped registers.

I Have only added the <sf:SfListView.GroupHeaderTemplate> tag to the XAML and listView.DataSource.GroupDescriptors.Add() line to the code behind.

Has anyone here ever been through this issue and can tell me how to get work around it?

The code is available at GitHub

Thanks,

LKnett

Gnana Priya Namasivayam [Syncfusion]
Replied On November 21, 2019 11:58 AM UTC

Hi Leopoldo, 
Thank you for using Syncfusion products.  
  
We have checked the reported query “Swipe returns wrong index for the item when Grouping is enabled. We let you know that the ItemIndex does not represent the index of the item in the ItemsSource collection, it represents the index of display items of SfListView. Hence you can achieve your requirement by using ItemData which you can get in SwipeEndedEventArgs instead of ItemIndex.  
  
Please refer the following code example for the same, 
        private void ListView_SwipeEnded(object sender, SwipeEndedEventArgs e) 
        { 
            var data = e.ItemData as Register; 
            var registers = listView.ItemsSource as List<Register>; 
            _index = registers.FindIndex(itemData => itemData == data); 
        } 
We hope this helps. Please let us know if you would require 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