11

Question 1.1

What interface do I need to implement into my custom web part, to make it a provider for "filter values" for a normal XsltListViewWebPart?

Answer - IWebPartParameters

"XSLT List View Web Part"
"Provider Connections - IWebPartTable, IWebPartRow
Consumer Connections - IWebPartParameters"

...from page 385 from "SharePoint 2010 Web Parts in Action", online pdf reader

Question 1.2

And how do I implement it correctly?

public class ProjectPhases : WebPart, IWebPartParameters 
{
    protected override void CreateChildControls()
    {
        // Something
    }
    public void GetParametersData (ParametersCallback callback)
    {
        // ??
    }
    public void SetConsumerSchema (PropertyDescriptorCollection schema)
    {
        // ??
    }
    public PropertyDescriptorCollection Schema
    {
        // ??
    }
}

Question 2.1

Does this Interface implement a method returning a CAML query?

Answer - I doubt it, because of the generic name of the interface, "IWebPartParameters"

Question 2.2

In what form do I send the data to the consuming XsltListViewWebPart which makes it filter the list?

The goal

This is how I want any XsltViewWebPart acting as a "consumer" to act, once my Custom Web Part acts as a "provider": Wanted end result


What I've learned so far:

I've understood that there are some filter Web Parts available in SharePoint Enterprise, sadly I'm working with Server Edition. These Web Parts reside inside the Microsoft.Office.Server.FilterControls.dll.

A method of importance i belive:
SetConnectedFilterProvider - Sets the IWebPartParameters instance from the filter provider to the DataFormWebPart. (Inherited from DataFormWebPart.) msdn XsltListViewWebPart Methods


Some links providing info about "Connected Web Parts"

1 Answer 1

1

Since you already referring to (my) the SharePoint 2010 Web Parts in Action book, you have all your answers on page 349 "Connect using IWebPartParameters".

You basically work with a set of property descriptors that each has a type, name and value. This is only parameters you're sending from the provider to the consumer. The consumer tells what properties it can accept (type and name) and the provider says it can deliver properties (type and name) with values.

1
  • Thank you for your answer! I'm honored that the famous Wictor Wilén himself takes his time to answer my question. I'm continuing reading your book and trying to understand the plumbing so I can write the providing interface myself.
    – Tim
    Commented Dec 2, 2011 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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