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

Toggle listview item background color on item click

1 Answer 152 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
user1843640
Top achievements
Rank 1
user1843640 asked on 11 Dec 2012, 09:19 PM
Given a viewmodel which contains an array of objects that have a boolean property (Selected), how should I set the background color of the ListView items dynamically.  I have tried to use the style binding which works fine when the ListView first loads but the ListView is not updated as the items "Selected" property change (on click).

Here is the fiddle.

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 12 Dec 2012, 11:52 AM
Hello,

You have to use the get and set MVVM methods in order to modify an object state. 

All the best,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView (Mobile)
Asked by
user1843640
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or