How to: Set Alternating Row Styles ?

2 posts, 0 answers
  1. Evgeny Vdovin
    Evgeny Vdovin avatar
    29 posts
    Member since:
    May 2006

    Posted 29 Sep 2011 Link to this post

    How to set Alternating Row Styles in combobox? I just need to have light-gray background to separate item. Any example ?

    Evgeny Vdovin
  2. Pana
    Pana avatar
    748 posts

    Posted 05 Oct 2011 Link to this post


    You could create a StyleSelector that alternates the returned style. Add it an EvenStyle and OddStyle properties and every time a SelectStyle is invoked swap the styles. Please check the attached project.

    Note that if you are using virtualized RadComboBox you may need to add something like "id" to your view model items since the SelectStyle will be called pretty much at random scrolling up and down. In that case you will be able to return one of the styles if the id%2 == 0 and the other otherwise.

    All the best,
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top