Another dumb datagrid view question; sorry ;-)

B

Bob

Vs2055, vb.net. I have two related datagridviews they're both bound to
related tables. Best way to give idea is as follows.
Parent datagrid is a list of companies. Child datagrid is a list of
employees for each company. So far so good. Child company has an internal
Primary key foreign key Reports to (much like the Employee table in
Northwind). In Child grid I have a combobox that needs to display the
employees ONLY of the currently selected company in the Parent Company Grid.
So Far I can populate the combox OK but I realize that as I switch companies
in the parent grid the combox stays populated with the employees of Company1
(im my test I have Company 1 that has employees and company 2 that does not
have any in the tables), so when I start wuith company 1 I see all the
employees as available in the combox but when I switch to company 2 I should
not see any in the combobox, the employees grid populates OK with the
correct child employees only. Problem is employees from Company 1 are all
there in the combox even when I switch to company two so I suspect that the
combox loads all of the table and does not apply filters as company
selection is changed. Yet what I selected as a datasourve for the combobox
is the employee table related to the company table in the dataset that has
both tables correctly related so I thought that the on company change the
child employees would be displayed automatically in the combox much as they
are in th employees grid. But that's not what is happening. I'm missing
something here. I would really appreciate any help in resolving and bettre
understanding this issue.

Thanks for any help,

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top