Re: Using BindingNavigator and ComboBox of data bound items
- From: bds <bds@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 17 Aug 2005 21:14:03 -0700
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
>
>
>
.
- References:
- Using BindingNavigator and ComboBox of data bound items
- From: bds
- Re: Using BindingNavigator and ComboBox of data bound items
- From: Bart Mermuys
- Using BindingNavigator and ComboBox of data bound items
- Prev by Date: how do i launch the browser with the file I want loaded?
- Next by Date: Restrict Access of Class
- Previous by thread: Re: Using BindingNavigator and ComboBox of data bound items
- Next by thread: Is it possible to develop smartdevice app on .net 4.2 with vs2005 ?
- Index(es):
Relevant Pages
|