Hi,
I am trying to disable 2-3 options from my combo box using converter. I do not want to use IsEnabled property as my data is dynamically populated. Therefore, I have created a converter for the same.
However, when I am using <Style.Triggers> my combo box is coming blank.
PFB the xaml code used.
<ScrollViewer.Resources>
<converters:ComboboxDisableConverter x:Key="itemDisableconverter"/>
<Style x:Key="EnableStyle" TargetType="telerik:RadComboBoxItem">
<Setter Property="IsEnabled" Value="True"/>
</Style>
<Style x:Key="DisableStyle" TargetType="telerik:RadComboBoxItem">
<Setter Property="IsEnabled" Value="False"/>
</Style>
<telerik:RadComboBox Grid.Row="0" Grid.Column="1" Name="MeterTypes"
VerticalContentAlignment="Center"
IsReadOnly="False"
DisplayMemberPath="Name"
ClearSelectionButtonVisibility="Visible"
ItemsSource="{Binding MeterTypes}">
<!--SelectedItem ="{Binding MeterTypes, Converter={StaticResource itemDisableconverter}, ConverterParameter={StaticResource itemDisableconverter}, Mode=TwoWay}">-->
<telerik:RadComboBox.ItemContainerStyle>
<Style TargetType="{x:Type telerik:RadComboBoxItem}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Text,
RelativeSource={RelativeSource Self}, Converter={StaticResource itemDisableconverter}, ConverterParameter={StaticResource itemDisableconverter}}" Value="true">
<Setter Property="IsEnabled" Value="False"/>
</DataTrigger>
</Style.Triggers>
<Setter Property="IsEnabled" Value="True"/>
</Style>
</telerik:RadComboBox.ItemContainerStyle>
Instead when I am using the commented SelectedItem, my ComboBox is populated but my options are not greyed out.
Can you please help me here.
Thanks.