Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

Changing DataViewManager.RowFilter has no effect

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jay Pondy - 15 Feb 2005 11:05 GMT
On Feb 12 I posted a request for some help with the subject "Changing the
DataViewManager.RowFilter has no effect".  I attached some sample code
written against Northwind demonstrating the problem.

I may not have been logged in with my MSDN Email account so I am reposting
my request under that account in the hopes that someone can take a quick look
and point out the error of my ways.

Thanks
Phil Williams - 15 Feb 2005 14:53 GMT
Hi Jay,
You don't seem to be getting any replies so I thought I would be it another
try.

If you have a look at the DataViewSettings class in the help, it reads
"Represents the default settings for ApplyDefaultSort, DataViewManager,
RowFilter, RowStateFilter, Sort, and Table for DataViews created from the
DataViewManager".

I think the key word here is DEFAULT.

dataSet.DefaultViewManager.DataViewSettings[ dataTable ].RowFilter =
"Category = 'Cat One'";
DataView dataView = dataSet.DefaultViewManager.CreateDataView(dataTable);
// dataView.RowFilter matches the Category = 'Cat One' from above
dataSet.DefaultViewManager.DataViewSettings[  dataTable ].RowFilter =
"Category = 'Cat Two'";
// dataView.RowFilter isn't updated - it's still Category = 'Cat One'

So it seems DataViewSettings[ dataTable ].RowFilter is only read when
creating a new DataView.

Hope this is of some help.

Best Regards,
Phil.

> On Feb 12 I posted a request for some help with the subject "Changing the
> DataViewManager.RowFilter has no effect".  I attached some sample code
[quoted text clipped - 5 lines]
>
> Thanks
Jay Pondy - 16 Feb 2005 12:15 GMT
Phil

Thanks for your continued efforts on this one.  I don't have my source here
today but I will take a look at it tonight and see if what your saying
applies.

My Dataset and DataViewManager are global objects in this application and I
did notice that if I close and then re-open the form that the
DataViewManager.RowFilter setting is applied.

> Hi Jay,
> You don't seem to be getting any replies so I thought I would be it another
[quoted text clipped - 32 lines]
> >
> > Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.