D
Dave Elliott
I've included a picture below to show what I am trying to accomplish.
It is best to copy/paste into notepad to get the spacing correct.
I have a dataset that contains 3 tables. Two of the tables contain
data and the third links them together. The dataset has a constraint
setup as well.
The first listbox and the first and last name text box are bound to
the Person DataTable. As you select a name in the listbox, the
textbox will be updated with the appropriate name. You can make
modifications to the name and have them updated in the listbox.
This works just fine. Now for the problem.
I need to have the second listbox populated with entries that are
specific to the person that is selected in the first listbox. This
restriction prevents me from directly binding to the Address
DataTable. Once I have the filtered data , I will then need to have
the same editing capabilities as listed above.
Ideally, I would like to do databinding as I will be writing the
values back into the database. I'm just not sure how to filter and
bind at the same time.
If you have a code example somewhere or just a basic "here's what you
need to do" list or any thoughts on how to accomplish this, I would
love to hear about it.
Thanks,
Dave
+--------------+ +--------------+ +--------------+
| Person | | Person2Addr | | Address |
+--+-----------+ +--+-----------+ +--+-----------+
|PK| ID |>---|PK| PersonID |---<|PK| ID |
| | LastName | |PK| AddressID | | | City |
| | FirstName | +--+-----------+ | | State |
+--+-----------+ +--+-----------+
+-----------------------------------------------------------+
| +------------+ +------------+------------------------+ |
| | Listbox | | First Name:| Jane | |
| +------------+ +------------+------------------------+ |
| | Smith,Jane | | Last Name: | Smith | |
| | Smith,John | +------------+------------------------+ |
| +------------+ |
| |
| +--------------+ +--------+----------------------------+ |
| | Listbox | | City: | St. Louis | |
| +--------------+ +--------+----------------------------+ |
| | St.Louis, MO | | State: | MO | |
| | Raleigh, NC | +--------+----------------------------+ |
| +--------------+ |
+-----------------------------------------------------------+
It is best to copy/paste into notepad to get the spacing correct.
I have a dataset that contains 3 tables. Two of the tables contain
data and the third links them together. The dataset has a constraint
setup as well.
The first listbox and the first and last name text box are bound to
the Person DataTable. As you select a name in the listbox, the
textbox will be updated with the appropriate name. You can make
modifications to the name and have them updated in the listbox.
This works just fine. Now for the problem.
I need to have the second listbox populated with entries that are
specific to the person that is selected in the first listbox. This
restriction prevents me from directly binding to the Address
DataTable. Once I have the filtered data , I will then need to have
the same editing capabilities as listed above.
Ideally, I would like to do databinding as I will be writing the
values back into the database. I'm just not sure how to filter and
bind at the same time.
If you have a code example somewhere or just a basic "here's what you
need to do" list or any thoughts on how to accomplish this, I would
love to hear about it.
Thanks,
Dave
+--------------+ +--------------+ +--------------+
| Person | | Person2Addr | | Address |
+--+-----------+ +--+-----------+ +--+-----------+
|PK| ID |>---|PK| PersonID |---<|PK| ID |
| | LastName | |PK| AddressID | | | City |
| | FirstName | +--+-----------+ | | State |
+--+-----------+ +--+-----------+
+-----------------------------------------------------------+
| +------------+ +------------+------------------------+ |
| | Listbox | | First Name:| Jane | |
| +------------+ +------------+------------------------+ |
| | Smith,Jane | | Last Name: | Smith | |
| | Smith,John | +------------+------------------------+ |
| +------------+ |
| |
| +--------------+ +--------+----------------------------+ |
| | Listbox | | City: | St. Louis | |
| +--------------+ +--------+----------------------------+ |
| | St.Louis, MO | | State: | MO | |
| | Raleigh, NC | +--------+----------------------------+ |
| +--------------+ |
+-----------------------------------------------------------+