Solved

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

Posted on 2008-09-30
2
641 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

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