Search code examples
silverlightsilverlight-4.0wcf-ria-services

Can you selectively enable or disable 'FilterDescriptors' in silverlight 4?


In Silverlight with RIA services it is very easy to implement simple data filtering with 'FilterDescriptor' instances.

However I've got a case where I have several filters and I want to enable or disable them based on other filters.

It seems like a simple 'Enabled' property would make this really easy - but there is none.

Is there a way to achieve this without just manually defining all the filters I need every time the relevant checkbox is checked. Perhaps a subclass? (I haven't had time to try this myself yet)


Solution

  • I am doing this by setting each one to -1 by default, and have the IgnoredValue="-1" in the FilterDescriptor. You can also use null or Nothing depending on your language your using. Ken