Hello,
I’m trying to bind Dictionary<string, object> parameters with my combo box, but I don’t know how to do that.

This is my code:

Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("option1",parameters);
            parameters.Add("option2", parameters);
            parameters.Add("Option3", parameters);

I would like to get option1, option2 and option3 in combobox on my Windows Form Applikation

Thanks for your help.

comboBox1.DataSource = new BindingSource(parameters, null);
comboBox1.DisplayMember = "Key";
comboBox1.ValueMember = "Value";
comboBox1.DataSource = new BindingSource(parameters, null);
comboBox1.DisplayMember = "Key";
comboBox1.ValueMember = "Value";

Thanks very much, it works.

Big Thanks for your help.:)

Edited 5 Years Ago by cool_intentions: n/a

This question has already been answered. Start a new discussion instead.