Select item after changing DataSource of listview

Hi
I can't speak English. So I use Google Translate.
Please understand if the explanation is not natural.

I want similar functionality to this post.

I am trying to select a specific Item after changing the DataSource of the ListView in the combobox's ValueChange event.

However, when using the SelectItem Method of ListView, the following message is displayed.
"The method is deprecated and will no longer be used"

Even if it is executed, the function does not work.

How can I programmatically select an Item in a ListView?
Any help would be appreciated.

5 Replies 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team October 7, 2020 01:27 PM UTC

Hi JaeHyeong Jang,  
 
Greetings from Syncfusion support. 
 
We have checked your requirement with ListView component. By default, ListView is used for displaying the list items and clicking on the items in the ListView component. We will not maintain the pre-selection in ListView component. So, we have deprecated the selectItem method. 
 
We can maintain the selection only by enabling the checkbox property of ListView component. We can check the items by using checkItem method of ListView component. This is the default behaviour of ListView component. 
 
If you want to select the list items without using checkbox property,  we suggest you to use the ListBox component which is similar to ListView component. You can use that component to achieve your requirement.  
 
Refer the below link for ListBox component. 
 
 
 
Could you please check the above links and  please share the details that the above component meet your requirement or not. 
 
Refer the below link for checkbox property in ListView component. 
 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Marked as answer

JJ JaeHyeong Jang October 7, 2020 02:36 PM UTC

Hi

Thanks for the reply.

I needed a List of Grid Layout.
I used ListView by referring to the following post.

Is there a way to use ListBox as Grid Layout?
Any help to me would be appreciated.


MK Mohan Kumar Ramasamy Syncfusion Team October 8, 2020 02:14 PM UTC

Hi JaeHyeong , 
  
Sorry for the inconvenience caused.  We have checked your reported requirement, Currently Listbox template not working in our end. We have logged a issue report for this and we will include this fix in our upcoming patch release. You can track the status in the below feedback link. 
  
 
We can achieve your requirement using previous version (18.2.059). For your reference, we have prepared a sample for please refer below link. 
 
 
Regards, 
Mohankumar R 



JJ JaeHyeong Jang October 9, 2020 12:46 AM UTC

Hi

Thanks for the reply.
I look forward to a fix in the next release.


MK Mohan Kumar Ramasamy Syncfusion Team October 9, 2020 01:46 PM UTC

Hi JaeHyeong , 
 
We have resolved Listbox template issue and this fix will be included in our upcoming patch release. Until then appreciate your patience.   
 
Regards, 
Mohankumar R 


Loader.
Up arrow icon