I've got this code to assign a Dictionary to a combobox:
Dictionary<String, String> dict = ReportRunnerConstsAndUtils.GetReportGeneratorsDictionary();
comboBoxReportRunners.DataSource = new BindingSource(dict, null);
comboBoxReportRunners.DisplayMember = "Key";
comboBoxReportRunners.ValueMember = "Value";
I want to verify that the items' DisplayMembers and ValueMembers are what I hope they are. This seems like a logical way to test that:
foreach (var v in comboBoxReportRunners.Items)
{
MessageBox.Show(v.DisplayMember.ToString());
MessageBox.Show(v.ValueMember.ToString());
}
...but it doesn't compile; I get, "'object' does not contain a definition for 'DisplayMember' and no extension method 'DisplayMember' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)'" and the same err msg for 'ValueMember'
What do I need to see (one time only) what values are stored as each Items' DisplayMember and ValueMember?