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

Get the unselected items from sfListView

Thread ID:





131602 Jul 19,2017 04:22 AM UTC Jul 20,2017 06:03 AM UTC Xamarin.Forms 3
Tags: SfListView
Asked On July 19, 2017 04:22 AM UTC

Hello!  I have a program that contains an sfListView.  It has an event OnSelectionChanged that runs some code and changes the visuals of a cell when a cell is tapped.  It then marks the cell as selected.  I can then call all of the selected cells and place them into a List<T> by calling listView.SelectedItems.  Is there a good solution for getting the items that were NOT selected?  

Dinesh Babu Yadav [Syncfusion]
Replied On July 19, 2017 01:39 PM UTC

Hi Tommy,   
Thank you for using Syncfusion Products.   
The reported requirement “Get unselected items in SfListView” can be achieved by a workaround in sample level. In the sample, you can filter the SelectedItems and unselected items from the underlying collection like below code example.   
Code Example[C#]:   
private void listView_SelectionChanged(object sender, ItemSelectionChangedEventArgs e)   
  var unselecteditems = new List<Contacts>();   
  var selecteditems = new List<Contacts>();   
  for (int i = 0; i < viewModel.contactsinfo.Count; i++)   
    var item = viewModel.contactsinfo[i];   
    if (listView.SelectedItems.Contains(item))   
Please let us know if you require further assistance.   
Dinesh Babu Yadav   

Replied On July 20, 2017 02:50 AM UTC

Thank you Dinesh!  This put me on the right path.

Dinesh Babu Yadav [Syncfusion]
Replied On July 20, 2017 06:03 AM UTC

Hi Tommy, 
Thank you for your valuable feedback. 
Dinesh Babu Yadav 


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