Row filtering in parent child relationship

  • Thread starter Thread starter Danny Popov via .NET 247
  • Start date Start date
D

Danny Popov via .NET 247

Hello all, I'm relatively new to the .NET framework and like toexhaust all resources before asking for help, but I've finallybeen stumped. The scenario: I have two database tables: PURCHASE and PURCHASE_LINE, with a one-to-many relationshipdefined between PURCHASE and PURCHASE_LINE. On my form I haveone datagrid for each table, both of which are bound to the samedataview object. I can successfuly perform a row filter onfields in the PURCHASE table, and corresponding line items willbe shown in the other data grid. What I really need to dothough, is also allow purchases to be filtered based upon if acertain item is contained in the PURCHASE_LINE table for thatpurchase. I tried the Child.FieldName syntax only to discoverthat it can only be used in an aggregate function. Is what I'mtrying to do even possible? Are there workarounds? Thanks amillion for any suggestions!
 
Would it be possible to add an expression column to the PURCHASE_LINE which
returned 1 indicating whether the row meant the criteria and 0 if it didn't?

Then use an aggreate sum as the rowfilter where if the value > 0 the
PURCHASE went in the view.

Andrew Conrad
Microsoft Corp
 
Back
Top