I've bound my ComboBox
SelectedValue
to a string
in my codebehind, but when the value is set, the string becomes a ComboBoxItem
. How do I just bind the selected value as a string?
This is probably because you have ComboBoxItem
objects as items in your ComboBox
and string is a content of each ComobBoxItem
. So try setting SelectedValuePath
to "Content" on your ComboBox
:
<ComboBox SelectedValuePath="Content" .../>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With