Filter child rows from DataView

I have a dataset with two tables (Parent) and (child)

I have added a relation between thest two tables
dsPO.Relations.Add("Parent2Child",
dsPO.Tables("Parent").Columns("ID"),
dsPO.Tables("Child").Columns("ID"))

I filtered Inventory table for price>0
dsPO.Tables("Parent").DefaultView.RowFilter = "Price>0"

and assign to a datagrid
grdDetails.DataSource = dsPO.Tables("Parent").DefaultView

My question is is there any way filtering child rows. I want to filter for
Strike > 10 in Child table. When I put .
dspo.Tables("Child").DefaultView.RowFilter ="Strike > 10'"
Datagrid doesn't change or filter child rows.
LVL 8
97WideGlideAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Anurag ThakurTechnical ManagerCommented:
do you have 2 data grids or only one data grid
if there are 2 data grids one showing the parent and the other children then in that case when a parent is selected (index changed) you need to do a child row filter for that parent and then rebind the second grid
0
97WideGlideAuthor Commented:
I have only one data grid which displays the vew in hierarchical fashion.  
When you say "do a child row filter" do you mean to iterate through all the parent rows requesting the related childview of each parent row and filtering ?  I was trying to do it that way but my tables are pretty large (Parent 5K and Child 300K) and this was taking a prohibitively long time.  

Also, I need to filter the entire child table at once because I also need to present a cumulative total of all unfiltered children.  
0
Anurag ThakurTechnical ManagerCommented:
i dont think (my view point) what you are trying to achieve is a good approach

in such a circumstances i would have had a gridview in which i will show all the parents and when i select a parent i will reload the children in a details view
the only drawback that i see is that there is going to be a postback on every parent selected
if such is done then large data problem is solved.
0
97WideGlideAuthor Commented:
Keep in mind that I will be processing this data so it is not just a question of how best to display it.

So, with that in mind, using your solution, how will I get things like a count of all of the rows which made it through the child filter?

For example, consider a parent table of 5K junkyards and a child table of 300K salvage parts in those junkyards.  I want to be able to filter the junkyards to get say, all located West of the Missippi.  Then I want to further filter the child table to limit the parts to all those valued more than say, $1000 or those which cost less than $30 to ship, or both.  At any given time I want to have a count of the total number of junkyards and parts that remain unfiltered.  
0
97WideGlideAuthor Commented:
Found a solution.  
A DataViewManager solves this problem very well.  Just remember to rebind the DVM after filtering or sorting so that the updates are available to your grid.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.