This is a migrated thread and some comments may be shown as answers.

How to select first item in ListView and update the GUI

3 Answers 618 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Morten asked on 19 May 2015, 08:51 AM

I would like to initially select the first item in a listview bound to a viewModel:

http://jsbin.com/xawemuwonu/2/

The change event fires on page load, however, how do I have the list view updated as if I had manually selected the item?

3 Answers, 1 is accepted

Sort by
0
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 19 May 2015, 08:58 AM
http://jsbin.com/xawemuwonu/2/edit?html,output
0
Alexander Valchev
Telerik team
answered on 21 May 2015, 07:36 AM
Hello Morten,

You should select the item after the data is bound, e.g. at the dataBound event.
Check the updated example: http://jsbin.com/sofesasari/1/edit

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 21 May 2015, 08:51 AM

Hi Alexander,

thanks a lot. That worked.

/Morten

Tags
ListView
Asked by
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Alexander Valchev
Telerik team
Share this question
or