Home All Groups Group Topic Archive Search About

Filtering the view of a dataset

Author
21 Dec 2006 10:06 AM
Mikaël_PLOUHINEC
Hello,

I have a dataset with 2 DataTables : Groups and Persons. I make a
relation between this 2 DataTables using one DataColumn in each
datatable. Finally I use this dataset in a dataGrid. So I would like to
have a display like :

groupe1
groupe2
+    (person1)
+    (person2)
groupe3

Everything is ok.

But if I want to filter my query on person (for example birthday), My
gid display all groups and only the person corresponding to my filter.

I would like to know if there is a way to display only groups which
correspond to filter persons (if a group doesn't have persons
corresponding to my birthday filter, I don't want to display this group).

Does someone have got any idea?

Thanks a lot.

Mike

Author
21 Dec 2006 12:28 PM
Miha Markic [MVP C#]
Collect group ids from filtered persons and use them to filter (ID IN
(....)) dataview that you are using to display groups (usually this is
grouptable.DefaultView).

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"Mikaël PLOUHINEC" <mikael_plouhi***@yahoo.fr> wrote in message
news:u8EwMeOJHHA.1044@TK2MSFTNGP02.phx.gbl...
> Hello,
>
> I have a dataset with 2 DataTables : Groups and Persons. I make a relation
> between this 2 DataTables using one DataColumn in each datatable. Finally
> I use this dataset in a dataGrid. So I would like to have a display like :
>
> groupe1
> groupe2
> + (person1)
> + (person2)
> groupe3
>
> Everything is ok.
>
> But if I want to filter my query on person (for example birthday), My gid
> display all groups and only the person corresponding to my filter.
>
> I would like to know if there is a way to display only groups which
> correspond to filter persons (if a group doesn't have persons
> corresponding to my birthday filter, I don't want to display this group).
>
> Does someone have got any idea?
>
> Thanks a lot.
>
> Mike

AddThis Social Bookmark Button