This is a migrated thread and some comments may be shown as answers.
How to: Set Alternating Row Styles ?
1 Answer 10 Views
This is a migrated thread and some comments may be shown as answers.
Evgeny Vdovin
Top achievements
Rank 1
Evgeny Vdovin asked on 29 Sep 2011, 09:38 PM
How to set Alternating Row Styles in combobox? I just need to have light-gray background to separate item. Any example ?

Regards,
Evgeny Vdovin

1 Answer, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 05 Oct 2011, 06:51 AM
Hello,

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,
Pana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Asked by
Evgeny Vdovin
Top achievements
Rank 1
Answers by
Pana
Telerik team
Share this question
or