Answer the question
In order to leave comments, you need to log in
How to set item in combobox via binding?
The form is made in wpf, user control. There is a combobox on the form, linked to a dictionary:
public Dictionary Drives
{
get
{
return _drives;
}
set
{
if (value == _drives) return;
_drives = value;
OnPropertyChanged("Drives");
}
}
in xaml:
When fetching data, you need to display item(key) in combobox that corresponds to value. Value - known. Should work through binding, how to do it?
Answer the question
In order to leave comments, you need to log in
If you need to display value, why not bind a dictionary to it in which there is only value?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question