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

ListView Selected Item Loses CSS When ListView Loses Focus

Hi there,

When using ListView the selected item CSS stylying got lost when the user click outside the list (The list loses the focus) we even tested it with your Demo and the issue is there 


How can we maintain the selected item styling when the listview loses the focus


Thanks


3 Replies

LD LeoLavanya Dhanaraj Syncfusion Team November 3, 2022 07:43 AM

Hi Mahmoud,


Greetings from Syncfusion support.


ListView is used for displaying the list items, and we will not maintain the pre-selection in the ListView component. When we streamline this component to the Blazor standard in the 2020 Volume 3 release (18.3.35), we have deprecated all the selection-related methods (GetSelectedItems, selectItem, and SelectMultipleItems). Refer to the below release notes.   


https://blazor.syncfusion.com/documentation/release-notes/18.3.35/?type=all#listview 


The selection can only be maintained by enabling the ShowCheckBox property of the ListView component. We can check an item programmatically using the checkItem method of ListView. This is the default behaviour of the ListView component.


If you want to select the list items without using the checkbox property, we suggest you use the ListBox component to achieve your requirement, which is similar to the ListView component.


Refer to the following links for more details on ListBox component.  


https://blazor.syncfusion.com/demos/listbox/default-functionalities?theme=bootstrap4 


https://blazor.syncfusion.com/documentation/listbox/getting-started/ 


https://blazor.syncfusion.com/documentation/listbox/selection/    


Regards,

Leo Lavanya Dhanaraj



MA mahmoud November 3, 2022 05:04 PM

Hello,

I have a feature that I need to group items, conditionally select single and multible items, infinite scrolling and load more items when the user scroll to a certain threshold (like the infinite scrolling features on facebook, twitter, linkedin, etc)


Please provide some code samples or recommend the best component to use.


Thanks




MA mahmoud November 10, 2022 09:41 AM


Loader.
Live Chat Icon For mobile
Up arrow icon