Relationship between 2 tables

muro

Active member
Joined
Apr 30, 2018
Messages
26
Programming Experience
3-5
Hello dear friends,

I have 2 tables, parent and child relationship. When i select a row from the parent table all rows are shown in the childtable that belong to this parent, so far so good. Now i have another form, where i only need the childtable so i drag drop the dgv on the form. now comes the problem: in the dgv ALL records are shown, without the parent filtering. But i need to only show the child rows of selected parent table row.
 
In the first form, the filtering will happen automatically if the child BindingSource is bound to the parent BindingSource rather than the child DataTable. In the second form, you have no choice but to bind the BindingSource to the child DataTable so you have to do the filtering manually, i.e. set the Filter property of the BindingSource bound to the grid.
 
Back
Top Bottom