Hello everybody,

I have a dataset containing two related tables :

Master,
Detail.

I have used the designer to create a form
with two DataGridView.


I want to filter parent records so that only those
which don't have child records are listed.

In the Form_Load, I have created a DataView (dv)
with filter : "ISNULL(Count(Child.ID),0)=0" (where ID
is the primary key of Detail).
I then Fill the datatables : Master, Detail.
I then set the Master DataGridView's datasource property to dv.

The problem that I have :
When the Form is launched, the filtering is correctly done.
Now, if I had a row in Master, then add a child row to Detail,
the parent row in Master is still there !!!

Does the rowfilter only work at Fill time ?
It doesn't work with creations/deletions in Master !!

Is this a known bug ?

I would prefer have this solution work that the workarounds
described in the article Q321896 !!

Re: Rowfilter on child recorsd only works with Fill by Cor

Cor
Tue Aug 30 09:56:22 CDT 2005

Olrt,

In my opinion is one major difference between beta and released software
that the beta software cannot have bugs, there can be things that are not
completly well done in beta software.

However, why don't you use one of the datarelation samples as they are on
MSDN with Datagrid's. The dataview is not always the best solution in this.

Using the datagridview does not change anything in my opinion.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskcreatingmasterdetailslistwithdatagrid.asp

I hope this helps,

Cor




Re: Rowfilter on child recorsd only works with Fill by olrt

olrt
Tue Aug 30 10:10:13 CDT 2005

Hello,
Thanks for your help.

> The dataview is not always the best solution in this.
As for me, I don't think that what I want to do (filtering on children)
can be done
without using DataView