When using any control with data-binding or either standard ComboBox control or ComboBoxItem control on popup menu, toolbar or any popup in conjunction with setting the DataSource property you will need to set the BindingContext property manually as well.

Internally Windows Forms ComboBox takes the BindingContext from the parent control to perform DataSource binding. Since ComboBox is on popup there is no parent control available until after popup is displayed.

That means that if you set the DataSource property nothing will be displayed on ComboBox.

To make DataSource works you would have to set the BindingContext manually with something like this:

combo.BindingContext = this.BindingContext;

combo.BindingContext = Me.BindingContext

Where Me (this in C#) is reference to the parent form. You can place this code in from Form.Load event.

This would apply to any control that you use on popup and you wish to use DataSource property.

Related posts:

  1. Data Binding on undocked/floating Bars, dockable windows
  2. How to create custom columns when binding data to AdvTree
  3. How to use ItemPanel Data-Binding Features – WinForms
  4. How to popup menu with NotifyIcon
  5. How to display any control on popup