Question Clear a relation at runtime

Gr1m

New member
Joined
Jan 10, 2008
Messages
4
Programming Experience
1-3
Hi,

I have 2 datagridviews, Industry and Organisations. Both are bound to datasets and have a relation between them (each organisation belongs to an industry). I need to be able to select an industry on the first view and it must show the orgs in the 2nd view. This is easy, the relation and designer generated code handles this.

But now I need to be able to also show ALL organisations. To do this I added a union to the fill() command query of industry table, which adds a <<ALL>> item to the list of industries. I need the 2nd view to show ALL organisations when <<ALL>> is selected. How would be the best way to do this?

Thank you in advance
Eduard
 
You can consider changing the child bindingsource's datasource from what it is now (the parent bindingsource, datamember = the relation name) to just referencing the child data table directly (datasource = the dataset, datamember = "the child datatable name"). You can make this a toggle

I'd also suspend and resume binding before and after respectively
 
Back
Top