Custom Filter Provider

Custom Filter Provider

Old forum URL: forums.lhotka.net/forums/t/2133.aspx


cultofluna posted on Friday, January 12, 2007

Hello,

I'm testing the use of a customer filter provider that I want to use to filter two properties.

I've created a filterProvider based delegate CustomFilter and a FilterValue class that contains the properties to filter the BO list with. But I can't seem to apply the filter, because I can't (and don't) want to specify a propertyname.

My declaration:

FilteredBindingList<BO> list = new FilteredBindingList<BO>(boListInstance, CustomerFilter);

list.ApplyFilter(null, new FilterValue("A", "B"));

In the VB examples in the forum Rocky used Nothing to prevent using a specific property (at least I think that's what he meant to do?!), but VS bugs out on an ambiguous call error for the overloaded method ApplyFilter.

Any thoughts?

Regards,


RockfordLhotka replied on Friday, January 12, 2007

Yes, I was wrong in using Nothing/null - free-hand coding is troublesome - I want the forum software to include C# and VB compilers Wink [;)]

It should be

list.ApplyFilter("", new FilterValue("A", "B"));

Using an empty string will get the desired result without the ambiguous method issue.

cultofluna replied on Friday, January 12, 2007

Hmmm...I could have thought of that... Thanks! I can go to sleep now :)

Copyright (c) Marimer LLC