How to populate a ToolStripComboBox?

To access the wrapped combobox in toolstripcombobox and gain access to its ValueMember/DisplayMember/DataSource you have to write something like this:

ToolStripComboBox1.ComboBox.ValueMember = "YourValueField";

You shouldn't set ToolStripComboBox1.ComboBox.DataSource = null

If you set ToolStripComboBox1.ComboBox.DataSource = null then you can try

ToolStripComboBox1.ComboBox.DataSource = null
ToolStripComboBox1.ComboBox.DisplayMember= "DisplayName"
ToolStripComboBox1.ComboBox.ValueMember = "Value"
ToolStripComboBox1.ComboBox.DataSource = dataSource

Tags:

C#

.Net

Winforms