1
Answer

DataViewManager.Rowfilters and Child Filtering

Administrator

Administrator

21y
6.3k
1
Hi can anyone here help with this? I have a dataset that is populated with data from two related tables. I create a DataViewManager to manage views of the data based on dynamically created queries which are passed to the DataViewManager.RowFilter. The DataViewManager is bound to a datagrid which displays the results of the queries. The datagrid also displays the child data relating to each row by clicking on the + sign at the start of each row. Currently the queries I am adding to the RowFilter are based on the parent table, for example; dvManager.DataViewSettings["client"].RowFilter = "((region = 'Blah') OR ((region = 'Bluh')) AND ((area = 'Here') OR (area = 'There')) AND (gender = 'Male')"; - This approach works well, however I now need to filter records based on values in the child table. If I wanted to do this by going back to the {MSAccess}database I would be creating an SQL statement such as the one below; SELECT DISTINCT client.* FROM clientcat AS clientcat_1, clientcat AS clientcat_2, client INNER JOIN clientcat ON client.clientid = clientcat.clientid WHERE ((client.clientid=[clientcat].[clientid]) AND (clientcat.category='Literature')) AND ((client.clientid=[clientcat_1].[clientid]) AND (clientcat_1.category='Art Administration')) AND ((client.clientid=[clientcat_2].[clientid]) AND (clientcat_2.category='Performance')); According to MSDN the DataViewManager is capable of this functionality, although they do not offer any examples of exactly how to do it. My question is - Is it possible to query a DataViewManager in this way and can someone show me how? :)
Answers (1)