How to populate a ToolStripComboBox?
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
加载中,请稍侯......
精彩评论