This is a migrated thread and some comments may be shown as answers.
Is it possible to bind ListViewItemStyle properties to item properties?
1 Answer 8 Views
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 15 Feb 2019, 12:59 PM
Is it possible to bind ListViewItemStyle properties to item properties? or can you only bind to properties on the list itselfs binding context?  For example I'd like to change the border color for each item based on the status of each item.  I could implement something like this within the ListViewTemplateCell but it would make things a whole lot easier if I could do  it on the style.

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 18 Feb 2019, 09:50 AM
Hi Rob,

The properties of the ListView ItemStyles are bindable, however, the binding context that is passed there is the same as the one of the ListView, so this approach is not suitable for the scenario you have.

To accomplish conditional styling according to item's properties, you would need to use ItemStyle Selector, please go through the topic here: ListView: ItemStyle Selector for more details on the exact approach.

Let me know if you have any additional questions on this.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Asked by
Rob
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or