StrataFrame Forum

Populating ToolStripCombobox with BO...

http://forum.strataframe.net/Topic1927.aspx

By StarkMike - 7/24/2006

How do I populate a toolstripcombobox with a BO?



I also noticed that the only toolstrip you have is the maintenance form one. Is there any way to get your combo box on the toolstrip? Do you have your own version of the toolstrip?



Mike
By Trent L. Taylor - 7/24/2006

Toolstrips basically have a wrapper for combo boxes.  In fact, they inherit from a System.Windows.Forms.Combobox class.  To populate a toolstrip combo using data you will have to manually set the data source property as well as the ValueMember and DisplayMemeber.  To access the wrapped combo box it will look something like this.

        Me.ToolStripComboBox1.ComboBox.DataSource = MyBO.CurrentDataTable
        Me.ToolStripComboBox1.ComboBox.ValueMember = "ValueFieldName"
        Me.ToolStripComboBox1.ComboBox.DisplayMember = "DisplayFieldName"

Use this code whenever you need to populate the toolstrip combo box.