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

Select first item in Agular's Listview by default

Hi,

I want the first item in the list view to be selected when the page is loading so that I can change the background color to dark gray. For example in the screenshot below I want the "All the time" to be selected when the page is loading.



What is the best way to do that?

3 Replies

KR Keerthana Rajendran Syncfusion Team November 27, 2019 12:03 PM UTC

Hi Alireza, 
  
Thanks for contacting Syncfusion support. 
  
In our ListView component, we have provided selectItem method to select the list items. For your scenario, use actionComplete event to achieve this requirement. We have prepared sample for your convenience. Refer to the below link. 
  
  
 
Please let us know if you have any concerns. 
  
  
Regards, 
Keerthana.  



AK Alireza Kahaei December 3, 2019 03:11 PM UTC

Yes, now it works :)


KR Keerthana Rajendran Syncfusion Team December 4, 2019 05:42 AM UTC

Hi Alireza,  
 
Most welcome. We are glad to hear that the provided solution helped you to achieve your requirement. Please get back to us if you need any further assistance on this. 
 
Regards, 
Keerthana. 


Loader.
Live Chat Icon For mobile
Up arrow icon