Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
noticed the strange behavior of Databinding to ToolstripComboBox.Combobox when it is being added to ToolstripDropdown or Contextmenu. Normally I'm binding SQL data to ToolstripcomboBox.Combobox by following code.
<br />  Me.tspcbxTest.ComboBox.ValueMember = "ID"<br />  Me.tspcbxTest.ComboBox.DisplayMember = "Column_to_Dispaly"<br />  Me.tspcbxTest.ComboBox.FormattingEnabled = True<br />  Me.tspcbxTest.ComboBox.DataSource = Me.Table1BindingSource<br />  Me.Table1TableAdapter.Fill(Me.DataSet1.Table1)<br />

Though it works perfect on ToolstripcomboBox(es) on ToolStrip or MenuStrip, failed on ToolStripSpiltButton (or) ToolStripDropdown (or) Contextmenu.

Thanking in advance.
Please! :(
Posted

1 solution

try this
Me.tspcbxTest.ComboBox.BindingContext = Me.BindingContext
Me.tspcbxTest.ComboBox.ValueMember = "ID"
Me.tspcbxTest.ComboBox.DisplayMember = "Column_to_Dispaly"
Me.tspcbxTest.ComboBox.FormattingEnabled = True
Me.tspcbxTest.ComboBox.DataSource = Me.Table1BindingSource
Me.Table1TableAdapter.Fill(Me.DataSet1.Table1)
 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900