Link to home
Start Free TrialLog in
Avatar of Sheritlw
SheritlwFlag for United States of America

asked on

Binding colums from sql server to a combobox on a Toolstrip.

Hi Experts,

I am just getting used to binding.  I have never bound data before, but since I moved from VB 6 to VB 2008 I am trying to take advantage of data binding.
Problem is I have added a toolstrip/toolbar to a form and can see how I can add a combobox to the toolbar, but was wondering if I could bind columns to this combobox so that when a user selects a value, the related data would appear on the form.  
I am not using the navigation type toolstrip, just a regular toolstrip.
An example would be great.

Thanks,

Sheri
ASKER CERTIFIED SOLUTION
Avatar of Priest04
Priest04
Flag of Serbia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
theres a better way...

toolstripcomboboxInstance.ComboBox.BindingContext = Me.BindingContext 'the important bit ;)
toolstripcomboboxInstance.ComboBox.DisplayMember = "something"
toolstripcomboboxInstance.ComboBox.ValueMember = "something else"
toolstripcomboboxInstance.ComboBox.DataSource = someDataSource