Is it possible to bind ListViewItemStyle properties to item properties?

2 posts, 0 answers
  1. Rob
    Rob avatar
    16 posts
    Member since:
    Aug 2018

    Posted 15 Feb 2019 Link to this post

    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.
  2. Yana
    Admin
    Yana avatar
    5013 posts

    Posted 18 Feb 2019 Link to this post

    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
Back to Top