PC Review


Reply
Thread Tools Rate Thread

DataViewManager, DataRelations, and Filtering

 
 
LBC
Guest
Posts: n/a
 
      1st Aug 2003
I have a 3-tiered dataset (parent, child, grandchild) on which I have
defined a dataviewmanager object (dvmData). On my form, I have set
dvmData as the datasource for a datagrid that I am using for
navigation and want to be able to filter each tier. I have tried 2
scenarios to filter each tier of the datagrid.

1) If I set a row filter via DataViewSettings, I can filter the child
and grandchild without a problem but the parent will not filter.

My code for setting the filters using DataViewSettings is:
'parent - department
strDeptFilter = "dept_code = '001'"
dvmData.DataViewSettings("Depts").RowFilter = strDeptFilter
'child - subdepartment
strSubDeptFilter = "subdept_code = '08'"
dvmData.DataViewSettings("SubDepts").RowFilter = strSubDeptFilter
'grandchild -room
strRoomFilter = "room_code = '003'"
dvmData.DataViewSettings("Rooms").RowFilter = strRoomFilter
Datagrid1.datasource = dvmData

This will filter Subdepts and Rooms correctly but the Department
filter is ignored.

2) I created a Dataview (dvDepts) from dvmData setting the parent
table as the default view. Then I set the row filter on dvDepts, and
then the datasource of the datagrid to dvDepts:

dvDepts=dvmData.DataviewSettings("Depts").table.defaultview
strDeptFilter = "dept_code = '001'"
dvDepts.RowFilter = strDeptFilter
...same filter settings for child and grandchild as above
Datagrid1.datasource = dvDepts

All the data in the datagrid still displays properly and the
Department will now filter, but of course, the child and grandchild
filters are ignored because dvmData (where the settings for their
filters are) is no longer the datasource.

The first scenario seems like it should work.... I must be missing the
point somewhere. Any suggestions are greatly appreciated!

tia,
LBC
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataViewManager sheperson@googlemail.com Microsoft C# .NET 1 2nd Dec 2007 01:28 PM
RE: filtering with DataViewManager Andrew Conrad Microsoft ADO .NET 0 11th Mar 2005 01:31 AM
DataViewManager =?Utf-8?B?dmlzaGFs?= Microsoft ADO .NET 2 6th Mar 2005 07:23 PM
filtering with dataviewmanager mmj Microsoft ADO .NET 2 28th Jan 2004 04:35 PM
DataViewManager not filtering with Sort property set. ken busse Microsoft ADO .NET 5 5th Nov 2003 09:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:24 PM.