I find it hard binding data to a ToolStripComboBox
. It seems it doesn't have the ValueMember
and DisplayMember
properties.
How to bind it?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With