3

I need to modify the way the filter acts in the Silverlight Pivot viewer.

I have this filter:

Keywords:
x Keyword a
_ Keyword b
x Keyword c
_ Keyword d
_ Keyword e

The filter generates “Keyword a OR Keyword c”. What I need is “Keyword a AND Keyword c”.

Is that possible?

Any help is appreciated!

Martin Liversage
  • 104,481
  • 22
  • 209
  • 256
thomasmartinsen
  • 1,983
  • 14
  • 21

2 Answers2

2

What Poker Villain says is quite right but that doesn't mean the PivotViewer is not a solution for you. I had a similar problem with a system I've been working on and managed to find a suitable way of making the PivotViewer play nice. This will only work for JIT collections though since it relies on re-fetching the data.

Essentially the system I've been working on is a case management system. Much of the data associated with a case is mutually exclusive and so fits the model of the PivotViewer but there is also the ability to add 'tags' to a case and like you suggest, often the user will want to combinational logic there. Here's what I did to fix the problem.

First off,..you're gonna want a copy of Silverlight Spy. Now in the explorer tab of SSpy, you can drill right down the Visual Tree and look at the guts of the PivotViewer. Here's how mine looks...

alt text

You can see I've drilled right down into the control named 'PART_FacetPane'. Below that there's a bunch of CustomAccordianItems. Essentially, you just need to subclass the PivotViewer (that's why mine says PivotViewerEx) and override the OnApplyTemplate method.

In here you will be able to use GetTemplateChild or some other means to navigate the VisualTree and add another control yourself. In my project, I used a simple tag cloud control I'd previously built.

What I do is handle the events of the tag cloud control and append querystring values to the URL used to build the CXML and filter the data based on these parameters. It's not as fluid as being able to filter the data 'live' as it were but it's a solution for now.

It's probably worth mentioning that depending on your circumstances, you may need to add a final, randomly generated querystring value to the CXML URL so you don't get a cached copy of the data.

HTH, Stimul8d.

EightyOne Unite
  • 11,665
  • 14
  • 79
  • 105
0

bottom line ... NO. You get what you get with this control. (for now)

but you could generate a "dummy" facet that was the concatenation of all the keywords for an item. But if you had more than a few keywords, it would look very ugly.

Poker Villain
  • 241
  • 1
  • 5