MDL
MDL

Reputation: 271

Bind a List from a Database to a ComboBox Controls collection?

I can apply the first value from the database to the text of the combo box control like this:

Entities context = new Entities();

        comboBox1.DataBindings.Add(new Binding
            ("Text", context.table1, "column1", true));

But I would like to apply the results to a collection or list for the control to bind to and then all results will be returned when the drop down button is clicked. What property do I need to target? "SelectedValue" was not working for me...

Upvotes: 1

Views: 513

Answers (1)

radbyx
radbyx

Reputation: 9660

Maybe comboBox1.DataSource ?

Upvotes: 1

Related Questions