I've had a standard ComboBox working with this code:
<
ComboBox
x:Name
=
"comboWindow1"
SelectedValue
=
"{Binding Window1Page}"
ItemsSource
=
"{Binding listDashData, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath
=
"ddDashDescription"
SelectedValuePath
=
"ddDashName"
SelectionChanged
=
"comboWindow1_SelectionChanged"
>
<
ComboBox.ItemContainerStyle
>
<
Style
TargetType
=
"{x:Type ComboBoxItem}"
>
<
Setter
Property
=
"IsEnabled"
Value
=
"{Binding ddDashEnabled}"
/>
</
Style
>
</
ComboBox.ItemContainerStyle
>
</
ComboBox
>
I switched over to the RadComboBox, thinking I could do almost exactly the same thing. However when I select the drop down, I get no items. If I remove the ContainerStyle then that works a treat.
I've looked at the various examples in the help, but nothing seems to work.
Both these code examples fail:
<
UserControl.Resources
>
<
Style
x:Key
=
"ComboIsEnabledStyle"
TargetType
=
"{x:Type tel:RadComboBoxItem}"
>
<
Setter
Property
=
"IsEnabled"
Value
=
"{Binding ddDashEnabled}"
/>
</
Style
>
</
UserControl.Resources
>
<
tel:RadComboBox
x:Name
=
"comboWindow2"
SelectedValue
=
"{Binding Window2Page}"
ItemsSource
=
"{Binding listDashData, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath
=
"ddDashDescription"
SelectedValuePath
=
"ddDashName"
ItemContainerStyle
=
"{StaticResource ComboIsEnabledStyle}"
SelectionChanged
=
"comboWindow2_SelectionChanged"
>
</
tel:RadComboBox
>
<
tel:RadComboBox
x:Name
=
"comboWindow1"
SelectedValue
=
"{Binding Window1Page}"
ItemsSource
=
"{Binding listDashData, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath
=
"ddDashDescription"
SelectedValuePath
=
"ddDashName"
SelectionChanged
=
"comboWindow1_SelectionChanged"
>
<
tel:RadComboBox.ItemContainerStyle
>
<
Style
TargetType
=
"{x:Type tel:RadComboBoxItem}"
>
<
Setter
Property
=
"IsEnabled"
Value
=
"{Binding ddDashEnabled}"
/>
</
Style
>
</
tel:RadComboBox.ItemContainerStyle
>
</
tel:RadComboBox
>
I amended one of the Telerik ComboBox examples to demonstrate as that does exactly the same thing. Can't attach, so it's available here: ComboBoxCustomFilteringDemo.zip
I'm really stumped as to what I've missed, as this should really be such a simple thing to do.
BTW I'm running the latest 2015.1.225 WPF version