Hi,
I'm creating a ComboBox that contains a Dictionary<byte,string> (for ex.) and ClearSelectionbuttonVisibility = Visible.
It's all ok, but if I click on "Clear Selection", it gives me ad error (that I attached).
I had to declare my property SelectedItem as KeyValuePair<byte, string>.
Now, I think that the reason's error is that KeyValuePair<byte,string> is not nullable, then?
How can I do use Dictionary in this context?
<!--My ComboBox for Dictionary-->
<
telerik:RadComboBox
ItemsSource
=
"{Binding MyItems}"
SelectedItem
=
"{Binding SelectedItem,Mode=TwoWay}"
DisplayMemberPath
=
"Value"
SelectedValuePath
=
"Key"
Style
=
"{StaticResource FieldLongComboBoxStyle}"
/>
<!--Style-->
<
Style
x:Key
=
"FieldBaseComboBoxStyle"
TargetType
=
"telerik:RadComboBox"
BasedOn
=
"{StaticResource RadComboBoxStyle}"
>
<
Setter
Property
=
"Margin"
Value
=
"5"
/>
<
Setter
Property
=
"ClearSelectionButtonVisibility"
Value
=
"Visible"
/>
<
Setter
Property
=
"ClearSelectionButtonContent"
Value
=
"Clear selection"
/>
<
Setter
Property
=
"TextSearchMode"
Value
=
"StartsWith"
/>
<
Setter
Property
=
"EmptyText"
Value
=
"Valore non selezionato"
/>
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Left"
/>
<
Style.Triggers
>
<
DataTrigger
Binding
=
"{Binding CantUpdateModel}"
Value
=
"True"
>
<
Setter
Property
=
"IsReadOnly"
Value
=
"True"
/>
<
Setter
Property
=
"IsEditable"
Value
=
"False"
/>
<
Setter
Property
=
"IsHitTestVisible"
Value
=
"False"
/>
<
Setter
Property
=
"FontWeight"
Value
=
"Bold"
/>
</
DataTrigger
>
<
DataTrigger
Binding
=
"{Binding CantUpdateModel}"
Value
=
"False"
>
<
Setter
Property
=
"IsReadOnly"
Value
=
"False"
/>
<
Setter
Property
=
"IsEditable"
Value
=
"True"
/>
<
Setter
Property
=
"IsHitTestVisible"
Value
=
"True"
/>
<
Setter
Property
=
"FontWeight"
Value
=
"Normal"
/>
</
DataTrigger
>
</
Style.Triggers
>
</
Style
>