Ich habe ein paar verschiedene Wörterbuch-Strukturen, die ich in einer ComboBox anzeigen möchte.Anzeige Mitglieder des Wörterbuchs abhängig von Schlüssel in ComboBox
In JumpType.cs:
public SortedDictionary<int, List<string>> jumpCombination = new SortedDictionary<int, List<string>>();
Das Wörterbuch Struktur etwas wie folgt aussehen:
Key Values
1 Flygande
EjFlygande
2 Bak
Pik
Test
3 ...
ich zwei Comboboxen wie dies in meinem UI erstellt haben:
Select Key: _____________
| ComboBox |
-------------- __________
_____________ | OK |
Select Value: | ComboBox | ----------
--------------
In Form1.cs
InitializeComponent();
JumpType jt = new JumpType();
jt.addjumpCombination(); // populating the dictionary
if (jt.jumpCombination != null)
{
comboBoxJumpComboKey.DataSource = new BindingSource(jt.jumpCombination, null); // Key => null
comboBoxJumpComboKey.DisplayMember = "Value";
comboBoxJumpComboKey.ValueMember = "Key";
comboBoxJumpComboValue.DisplayMember = "Value";
}
Wie würde ich über gehen, um die entsprechenden Werte wählen entsprechend dem gewählten Schlüssel?
Vielen Dank im Voraus.
Liste Werte = jumpCombination [key] –
jdweng