Re: Using BindingNavigator and ComboBox of data bound items

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



That's it. Thanks.

I guess the key thing I was missing was dragging the whole table out (the
Shift table in my case).

--
-bds


"Bart Mermuys" wrote:

> Hi,
>
> "bds" <bds@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:B1463C41-3397-481F-99B4-D037B855F694@xxxxxxxxxxxxxxxx
> > I'm new to .net 2.0 and I'm trying to figure out the best way to create a
> > form that has a couple of controls and one of the controls is a combo box
> > with a data bound list of items from another table.
> >
> > To understand the problem more, consider using the AdventureWorks2000
> > database. I want a simple form that shows FirstName, LastName, and Shift.
> > Instead of the ShiftID, I want the shift name from the Shift table to be
> > displayed.
> >
> > Here's what I've tried:
> > 1. Create dataset with Employee table and Shift Table.
> > 2. Drag employee FirstName and LastName on the form
> > 3. A BindingNavigator and BindingSource were created when FirstName was
> > dragged onto the form.
>
> 4. Click on the arrow next to the Shift table ( not ShiftID )
> (4.1 If you don't see an option for combobox then click customize and check
> combobox)
> 4.2 Change Shift table to combobox
>
> 5. Drag Shift Table onto form, you should see a combobox on the form
>
> 6. Open combobox properties
> 6.1 Check if DataSource/ DisplayMember and ValueMember are correct
> 6.2 Expand (DataBindings)
> (6.3 If you see a binding for Text then click on the arrow and set the
> binding to None)
> 6.4 Click on the arrow next to SelectedValue and bind to
> EmployeeBindingSource - ShiftID
>
>
> That should make the combobox work in both directions (from and to
> Employee).
>
> HTH,
> Greetings
>
>
>
> >
> >
> > I have two problems:
> > 1. Once the data item list is displayed in the combobox, the Display
> > Member
> > (Shift.Name) is not the right display member for the display value
> > (employee.ShiftId). Do I have to synchronize the two BindingSources? Do
> > I
> > have to use only one BindingSource and join Employee and Shift in one
> > query?
> > Something else?
> >
> > 2. How do I make ShiftID get inserted or updated in the employee table
> > from
> > a selection in the comboBox?
> >
> > --
> > -bds
>
>
>
.



Relevant Pages

  • Re: Using BindingNavigator and ComboBox of data bound items
    ... I want a simple form that shows FirstName, LastName, and Shift. ... Create dataset with Employee table and Shift Table. ... A BindingNavigator and BindingSource were created when FirstName was ... (4.1 If you don't see an option for combobox then click customize and check ...
    (microsoft.public.dotnet.general)
  • Using BindingNavigator and ComboBox of data bound items
    ... I want a simple form that shows FirstName, LastName, and Shift. ... Configure the combobox to bind to the ShiftBindingSource ... Once the data item list is displayed in the combobox, the Display Member ... have to use only one BindingSource and join Employee and Shift in one query? ...
    (microsoft.public.dotnet.general)
  • command button to combo box
    ... i have number of commnad buttton in embedded in a sheet ... i want to shift to a combobox ... please guide me ...
    (microsoft.public.excel.programming)
  • RE: Database Confusion
    ... Why wouldn't a field in the employee table be for what shift the employee ... shift details and then a sub-form detailing how worked on that particular ... get around in access but when I try to build the database I get all confused. ...
    (microsoft.public.access.gettingstarted)
  • Re: Daily Work Hour Collection
    ... You can then create forms for entering time by shift or date or employee ... They need to record the time each employee spent in diffrent tasks for the ... Time Emp 1 spent on Task 1 ...
    (microsoft.public.access.tablesdbdesign)