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:
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:
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!