?
Solved

DataViewManager to filter parent and child relation

Posted on 2004-08-30
7
Medium Priority
?
1,462 Views
Last Modified: 2008-01-09
Hi Experts,

Here is my dataset:
datatableParent : columnFileId, columnFileName
datatableChild : columnFileId, columnPathId
                               
I want to filter the parent table to get only files in the path I want.
So with my dataviewmanager, I filter like this:
dataViewManager.DataViewSettings[datatablechild].RowFilter="columnPathId='5' "; for example.
But it seems to filter only the child and not the parent.
Any Idea to filter rows in a parent table depending on criteria met in a child table ?

Thanks in advance for your answers.

0
Comment
Question by:noulouk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11932724
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11932780
whoops im backwards ... You can't do it directly through rowfilters because you can only use aggregates ...

PARENT/CHILD RELATION REFERENCING

A parent table may be referenced in an expression by prepending the column name with Parent. For example, the Parent.Price references the parent table's column named Price.

A column in a child table may be referenced in an expression by prepending the column name with Child. However, because child relationships may return multiple rows, you must include the reference to the child column in an aggregate function. For example, Sum(Child.Price) would return the sum of the column named Price in the child table.

If a table has more than one child, the syntax is: Child(RelationName). For example, if a table has two child tables named Customers and Orders, and the DataRelation object is named Customers2Orders, the reference would be:

Instead you would use ... GetParentRows which will get all of the parents for the records in your view http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdatadatarowclassgetparentrowstopic.asp
0
 
LVL 9

Author Comment

by:noulouk
ID: 11932813
Thanks for reply, but I'm not agree with you. The best I can do is to use getparentrows method because the child view is filtered as I want (but the parent view not), so with getparentrows methods I'll be able to retrieve my rows when I filter the child rows.
I want to know if another solution is available and more easy than mine. For example, a solution that filters rows in a parent view depending on criteria met in a child view ?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 37

Accepted Solution

by:
gregoryyoung earned 2000 total points
ID: 11932856
you cannot use the children in the rowfilter per the information I posted (they are only available within aggregate functions)
0
 
LVL 9

Author Comment

by:noulouk
ID: 11932861
I find your post after posting mine. Now I'm agree with you.

Do you think it's possible ?
" For example, a solution that filters rows in a parent view depending on criteria met in a child view ?  "
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11932884
if there is to be only 1 row in the child sure ... you could filter off the average aggregate of the children ...
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11933075
the average of { 8 } is 8 :)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question