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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Select first item in Agular's Listview by default

Thread ID:





149443 Nov 26,2019 02:58 PM UTC Dec 4,2019 05:42 AM UTC Angular - EJ 2 3
Tags: ListView
Alireza Kahaei
Asked On November 27, 2019 06:39 AM UTC


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?

Keerthana Rajendran [Syncfusion]
Replied On 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. 

Alireza Kahaei
Replied On December 3, 2019 03:11 PM UTC

Yes, now it works :)

Keerthana Rajendran [Syncfusion]
Replied On 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. 


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

Live Chat Icon For mobile
Live Chat Icon