or
To clarify items in the list of a combobox I need to alternate background color, like in a gridiew or similar.



| <Style x:Key="GroupSecurityRadTreeStyle" TargetType="telerik:RadTreeViewItem"> |
| <Setter Property="CheckState" Value="{Binding IsGroupActivated,Mode=TwoWay, Converter={StaticResource CheckStateConverter}}"/> |
| <Setter Property="IsExpanded" Value="True"/> |
| </Style> |
| public class CheckStateConverter : IValueConverter |
| { |
| public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
| { |
| bool? result = (bool?)value; |
| if (result.HasValue) |
| { |
| return result.Value ? ToggleState.On : ToggleState.Off; |
| } |
| else |
| { |
| ToggleState o = ToggleState.Indeterminate; |
| return o; |
| } |
| } |
| public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
| { |
| ToggleState state = (ToggleState)value; |
| return state == ToggleState.On ? true : false; |
| } |
| } |