Solved

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

Posted on 2008-09-30
2
640 Views
Last Modified: 2012-08-14
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
0
Comment
Question by:Sheritlw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
Priest04 earned 500 total points
ID: 22638155
ToolStripComboBox control doesnt have a DataSource property, so you cant bind it. You could, however, populate it manually with data, and when user selects some item from ToolStripComboBox, use a SelectedIndexChanged event to populate data on the form.

Goran
0
 

Expert Comment

by:dgallimore
ID: 23536644
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
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question