I am adding items to the combo box as shown below:
readonly Dictionary<string, string> _persons = new Dictionary<string, string>();
....
foreach (string key in _persons.Keys)
{
cmbPaidBy.Items.Add(key);
}
I want to make the combo box more readable by showing the values from the dictionary (i.e. names). But I need human codes (no123, etc.) to retrieve from the database based on user input.
What is the right way to do this? How can I bind both the value and the key to a list item?
source
share