BindingList <T> dictionary equivalent in WinForms
In WinForms you can associate a dictionary through BindingSource
with a ListBox
Dictionary<string, GraphApiFunction> myDictionary = new Dictionary<string, GraphApiFunction>();
listBox1.DataSource = new BindingSource(myDictionary, null);
listBox1.DisplayMember = "Key";
listBox1.ValueMember = "Value";
However, changes after installing DataSource myDictionary
cannot be detected, and therefore the ListBox is not updated. For lists, there is a special BindingSource called a BindableList
var myBindableList = new BindingList<string>();
listBox1.DataSource = myBindableList;
My question
- is there any equivalent
BindingList<T>
for aDictionary
- or are there other ways to update the ListBox (without resetting
DataSource
with every change)?
+4
No one has answered this question yet.
See similar questions:
or similar: