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

Binding an Image to ListView for Selection

Hello.  I have been following the guide for customizing selected items, but am stuck at binding to the image in C#.  The XAML snippet doesn't help me much, so I am looking for some C# examples for adding check marks to a listview for Selected Items.

3 Replies

DB Dinesh Babu Yadav Syncfusion Team June 27, 2017 05:17 AM UTC

Hi Tommy, 
 
Thank you for using Syncfusion Products. 
 
The reported requirement “Need to show a image for the selected items in SfListView” can be achieved by customizing the view in the ItemTemplate property and 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. 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. For your reference, we have attached the sample which shows a tick mark image when an item is selected as per the reported requirement and you can download it from the below link. 
 
 
Please let us know if you require further assistance. 
 
Regards, 
Dinesh Babu Yadav 



PU pumaprog June 27, 2017 12:47 PM UTC

Thank you Dinesh.


DB Dinesh Babu Yadav Syncfusion Team June 28, 2017 04:55 AM UTC

Hi Tommy,  
  
Thanks for the update.  
  
Regards,  
Dinesh Babu Yadav 


Loader.
Up arrow icon