Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm working on a filter web part inherited from another developer and it's the first time I've worked on them. It currently allows for a single filter and another filter needs to be added. Initial thoughts are something like:

// Existing filter property
[ConnectionConsumer("ProgramEntityLevel", "ProgramEntityLevel", AllowsMultipleConnections = true)]
// New filter property
[ConnectionConsumer("ProgramEntityGuid", "ProgramEntityGuid", AllowsMultipleConnections = true)]
public void SetFilter(IFilterValues filterValues)
{
    // ...
}

However of course it's not possible to have multiple ConnectionConsumer attributes.

Any ideas?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

I presume you are using the ITransformFilterValues (or similar) interface? You may want to consider implementing the obsoleted filter interfaces instead, since by going via IFilterProvider you can simply send a FilterString such as Filter1=Value1&Filter2=Value2 to your connected consumer Web Parts.

When we developed FilterZen, we implemented the interface you used (for sending "multiple values") as well as the obsoleted interfaces (for sending "multiple filters"). This allowed for greatest compatibility with out-of-box and third-party consumer Web Parts.

share|improve this answer
    
Yes, using ITransformFilterValues. Combining the values seems to be the only way. Thanks for sharing how you developed your product! –  Alex Angas Dec 21 '09 at 0:18
add comment

Its not entirely clear what you want to achieve, so maybe if you could clearify the specs for the task?

I dont think you can have two filters in one filter web part.

Arguably a better design would be to split it up in two filter web parts, but according to this thread, the design for AllowMultipleConnections is that a provider can have more than one consumer, but not the other way around. At the end of the thread this however there seems to be some confusion to if that is the case or not, so you could test it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.