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

Show check image in a MultiSelect SfListView

Thread ID:





129347 Mar 14,2017 09:20 AM UTC Mar 15,2017 03:21 PM UTC Xamarin.Forms 1
Tags: SfListView
Marcial Gonzalez
Asked On March 14, 2017 11:25 AM UTC

Dear sirs,

I'm trying to make something similar to your example in the documentation about SfListView but I can't find a way with SelectionMode="Multiple":



public class Items


    [PrimaryKey, AutoIncrement]

    public int Id { get; set; }

    public string Name { get; set; }




public class Groups


    [PrimaryKey, AutoIncrement]

    public int IdGroup { get; set; }

    public string NameGroup { get; set; }

    public int IdItem { get; set; }







private Items myItem;

public Items SelectedItem


    get { return myItem; }



        myItem = value;






private ObservableCollection <Groups> group;

public ObservableCollection <Groups> AssignedGroup


    get { return group; }



        group = value;








<sfList:SfListView x:Name="listView" Grid.Row="1"






                   ItemsSource="{Binding AssignedGroup}"






            <Grid BackgroundColor="#4CA1FE" HeightRequest="45">

                <Label LineBreakMode="NoWrap"

         Margin="10,0,0,0" Text="Groups Assigned"


                      FontSize="18" TextColor="White"








            <Grid Padding="5" >


                    <ColumnDefinition Width="40"/>

                    <ColumnDefinition Width="*"/>


                     <Image Grid.Column="0" x:Name="selectionImage"


                            Source="{Binding IsSelected,

                           Converter={StaticResource BoolToImageConverter}}"


                     <Label Grid.Column="1" Text="{Binding NameGroup}"

                           TextColor="Black" FontSize="20" />









public class SelectionBoolToImageConverter : IValueConverter


    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)


        if ((bool)value)

            return ImageSource.FromResource("Selected.png");


            return ImageSource.FromResource("NotSelected.png");



    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)


        throw new NotImplementedException();




In the ViewModel, the AssignedGroup (derived from Groups table) contains all the groups stating whether the SelectedItem pertains or not to each group. If the Item is included in a group, the field IdItem contains the Id value of the item, or zero in the other case:






Group 1


Item 1 is NOT included in Group 1


Group 2


Item 1 is included in Group 2


Group 3


Item 1 is NOT included in Group 3

I’m trying to customize a SfListView in the same way of the example shown in


but I can’t figure how can I substitute the IsSelected with something like  

               AssignedGroup.IdItem == SelectedItem.Id

without Multibinding. I use the same converter than the one in the example, but nothing happens:

    <Image Grid.Column="0" x:Name="selectionImage"

           Source="{Binding IsSelected,

           Converter={StaticResource BoolToImageConverter}}" >

Please note that SfListView has SelectionMode="Multiple". The idea is when you select an item in the SfListView, change the underlaying AssignedGroup.IdItem = SelectedItem.Id, and when you deselect one, change AssignedGroup.IdItem = 0

Thank you very much for your help

Marcial González

Dinesh Babu Yadav [Syncfusion]
Replied On March 15, 2017 03:21 PM UTC

Hi Marcial, 
Thank you for using Syncfusion Products. 
We have checked the reported requirement “Need to show a check mark image for the selected items in SfListView” with the given code snippet and we would like to let you know that in order to change the appearance of selected items, temp(Example: IsSelected) property should be maintained in model class and bind to an image element in the ItemTemplate as like your code snippet. And IsSelected property of underlying data item has been updated based on the selection from SelectionChanged event of SfListView and therefore the selectedimage’s source is changed by using SelectionBoolToImageConverter converter. 
Can you share the below details? So, that we could able to analyze the issue better and update you with appropriate solution. 
  • Can you share where you have defined the SelectedItem property in content page and why it has been used?
  • Can you share your end requirement?
If your requirement is to update the “iditem” in Groups class in underlying collection when select based on SelectedItem, then we have prepared a sample to meet this requirement and you can download it from below location. 

Could you please check with the above sample?. If your requirement has not met, please modify the above sample and provide some more additional information about your requirement. So, that we could able to update you with appropriate solution. 

Please let us know if you require further assistance. 
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