Skip to main content

Weblog Ton Stegeman [MVP]

Go Search
Home
  

ODC 2008
If you have a question or suggestion, please contact me through Windows Live Messenger.
My status: .

If I am not online, please send me an e-mail.
Weblog Ton Stegeman [MVP] > Posts > Connecting filter providers to the DataFormWebPart?
Connecting filter providers to the DataFormWebPart?

In a number of posts I have written about filter providers and consumers and how to setup connections between them. I also described how you can add these connections through SharePoint Designer or in code. A number of people have asked me how to do the same thing for connecting a Filter webpart to the DataFormWebPart. I looked into it and it seems like something's missing. Or probably I am missing something here.... Hope someone can help. If you know how to handle this, please let me know! Below I will describe the problem a bit further:

In the SharePoint interface, you can connect a text filter webpart to the dataview webpart:

connections1

This works fine, you can now filter the contents of your data view based on the input of one of the filter webparts. It seems possible to set this connection in SharePoint Designer. It lets you pick the provider and the consumer webpart, but it never lets you setup the connection properly. You cannot choose the consumer field name like in the screenshot above:

connections2

If you look in the ASPX code of the page you were just editing, you will see SharePoint Designer added a SPWebPartConnection:

<SPWebPartConnections>
    <WebPartPages:SPWebPartConnection 
        ID="g_E11087D7B8494E28BB2965AB035AE147" 
        ConsumerConnectionPointID="DFWP Filter Consumer ID" 
        ConsumerID="g_1c4c9904_d783_4851_9f2d_ae60e4d2ec42" 
        ProviderConnectionPointID="ITransformableFilterValues" 
        ProviderID="g_90ecca6e_fed8_4ef0_8306_a7a167309c6f">
    </WebPartPages:SPWebPartConnection>
</SPWebPartConnections>

This does not have an option to configure the connection. Just like I described in this article, you need a transformer object to do that. In this case, you will need a transformer of type TransformableFilterValuesToParametersTransformer. This transformer however does not have any public properties that you can set. I expected a property like the MappedConsumerParameterName of the TransformableFilterValuesToFilterValuesTransformer transformer. The writer of this forum post found a private property of the TransformableFilterValuesToParametersTransformer called "_consumerFieldNames". By using reflection he was able to set the property, but I hope that is not the only way to solve this problem.

Hope someone out there can help!

Comments

There are no comments yet for this post.
Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Your city *


Type the name of the city you live in (making it easier to handle spam...)

CurrentDate *

Select the current date (see if this gives me fewer spam...)
Attachments

 Links

  SharePoint Object on CodePlex
  Screencast introducing SharePoint Objects
  Content by Type and Filter Web Parts on CodePlex
  Archive
  Archive (Calendar)

 My Latest Blog Posts

Scripting SharePoint 2007 setup: choices and conceptsUse SHIFT+ENTER to open the menu (new window).
Adventures in Visual Studio 2010: Migrate the Content By Type web part to SharePoint 2010Use SHIFT+ENTER to open the menu (new window).
Register SharePoint themes by using a featureUse SHIFT+ENTER to open the menu (new window).
SharePoint 2010 development on Windows 2008 Server R2 – Getting StartedUse SHIFT+ENTER to open the menu (new window).
New release SharePoint Objects: features and groupsUse SHIFT+ENTER to open the menu (new window).
Constructing the url to the SharePoint Edit Permissions pageUse SHIFT+ENTER to open the menu (new window).
Screencast: introduction to SharePoint ObjectsUse SHIFT+ENTER to open the menu (new window).
SharePoint 2007 and Reporting ServicesUse SHIFT+ENTER to open the menu (new window).
SharePoint Objects – Insight in usage of your SharePoint artifactsUse SHIFT+ENTER to open the menu (new window).
SharePoint 2007 Custom list schema and the Content Query Web PartUse SHIFT+ENTER to open the menu (new window).
SharePoint 2010 Silverlight Client Object Model – ExecuteQuery vs ExecuteQueryAsyncUse SHIFT+ENTER to open the menu (new window).
SharePoint 2010, the Client Object Models and Bing MapsUse SHIFT+ENTER to open the menu (new window).
Having fun with SharePoint 2010, Silverlight 3 and Bing MapsUse SHIFT+ENTER to open the menu (new window).
Connecting TFS 2010 projects to SharePoint sitesUse SHIFT+ENTER to open the menu (new window).
Adding a database to the SharePoint database Server using SPDatabaseUse SHIFT+ENTER to open the menu (new window).