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":
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"
- Walkthrough: Creating Connectable Web Parts in SharePoint Foundation
- How to build a consumer web part in SharePoint 2010 using IWebPartParameters that works with HTML Form Web Part and Filter Web Parts?
- Connecting XsltListViewWebParts together in code
- Programmatically connect two ListViewWebParts to Filter based on value of Provider Web Part
- Declarative Fun: Provisioning Web Part Connections in sandboxed solutions
- Negotiate Between Web Parts
- Implementation of IWebPartParameters web part