toolstripcombobox.count = 0

net_logo

March 27, 2015 | Posted in .Net

Having used a toolstripcombobox hosted in a Toolstrip, although having bound a list of objects to the combo using a new bindingsource the items wouldn’t show until the form had displayed and validated. To fix this (if some actuib such as validation is to be performed before the form loads) set the toolstripcombobox.combobox.bindingcontext to the forms bindingcontext which will force the binding to happen.

toolstripcombobox.combobox.bindingcontext = this.bindingcontext;

For more information see https://msdn.microsoft.com/en-us/library/system.windows.forms.control.bindingcontext%28v=vs.100%29.aspx

Read More →