|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Filtering the view of a datasetI 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 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). -- Show quoteMiha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "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 |
|||||||||||||||||||||||