B
B
bagos2015-03-02 21:54:56
Domain Name System
bagos, 2015-03-02 21:54:56

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

2 answer(s)
B
bagos, 2015-03-03
@bagos

Issue resolved, typo in OnPropertyChanged parameter

V
Vitaly Pukhov, 2015-03-03
@Neuroware

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 question

Ask a Question

731 491 924 answers to any question