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

How to get control selectionion and deselection inside sflistview

Thread ID:

Created:

Updated:

Platform:

Replies:

143347 Mar 15,2019 08:06 AM UTC Mar 18,2019 08:57 AM UTC Xamarin.Forms 1
loading
Tags: SfListView
ronak
Asked On March 15, 2019 08:06 AM UTC

i need to create the label dyanmically inside my listview on which user can select and deselect the options inside listview, i want to show this controls in horizontal direction and each this controls have thier own grouping 
can u please help me how can i achieve this functionality using sfcontrols

i have attached the screenshot 

Attachment: helty_928f0ba1.zip

Deivaselvan Y [Syncfusion]
Replied On March 18, 2019 08:57 AM UTC

Hi Ronak, 
 
Thanks for contacting Syncfusion support. 
 
We have checked the reported query from our side. You can load items in SfListView GridLayout by defining SpanCount which places the items in horizontal direction as you mentioned, and you have to define listview with Selection Mode as `Multiple` in order to select items. We have attached the sample for your reference, please refer the sample from below link: 
 
 
 
<syncfusion:SfListView  x:Name="listView" SelectionMode="Multiple" 
                        SelectedItems="{Binding SelectedItems}" 
                        ItemsSource="{Binding contactsinfo}"> 
</syncfusion:SfListView> 
 
 
You can bind the `SelectedItems` to ListView in xaml page by adding the items into SelectedItems in ViewModel as added in sample. 
 
 
public class ContactsViewModel : INotifyPropertyChanged 
{ 
     public ObservableCollection<object> SelectedItems { get; set; } 
 
     public ContactsViewModel() 
     { 
         SelectedItems = new ObservableCollection<object>(); 
 
         SelectedItems.Add(contactsinfo[0]); 
         SelectedItems.Add(contactsinfo[1]); 
     } 
} 
 
 
To know more about Selection in SfListView, please refer our below documentation. 
 
 
Can you please check and let us know whether provide sample meets your requirement. If not, please explain your use case in detail so that we can able to provide the better solution at our end. 
 
Regards, 
Deivaselvan 


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

;