I want an XsltListViewWebPart filtered based on some custom metadata derived from the current user. Following Claudio Brotto’s article http://blog.claudiobrotto.com/2012/extending-base-xslt-web-parts-with-custom-control-bindings , I created a web control that returns a caml query fragment containing my dynamic filters. I added then a parameter binding which modifies the original caml query adding this fragment to it.
The filtering seems to work but I had now two problems: - The heading column filters don’t work anymore - The element group counter is correct but when I expand the element group list the items inside are not filtered
The query fragment result from binding is:
<In><FieldRef Name='Title'/><Values>
<Value Type='Text'>MP016</Value>
<Value Type='Text'>MP150</Value>
</Values></In>

<WebPartPages:XsltListViewWebPart runat="server" .......>
<DataFields/>
<ParameterBindings>
........
<ParameterBinding Name="CAMLQueryValuesCodiciPdv" Location="Control(CamlQueryPdvFilter1,Caml)" DefaultValue="<IsNotNull> <FieldRef Name='ID' /> </IsNotNull>"/>
</ParameterBindings>
<XmlDefinition>
<View>
<Query>
<GroupBy Collapse="TRUE" GroupLimit="30">
<FieldRef Name="pippo"/>
</GroupBy>
<Where>
<And>
{CAMLQueryValuesCodiciPdv}
<Or>
<Eq>
<FieldRef Name="pippo"/>
<Value Type="Text">bolla</Value>
</Eq>
<Eq>
<FieldRef Name="pippo"/>
<Value Type="Text">fattura</Value>
</Eq>
</Or>
</And>
</Where>
</Query>
<ViewFields>
<FieldRef Name="pippo"/>
<FieldRef Name="LinkTitle"/>
<FieldRef Name="plluto"/>
</ViewFields>
<RowLimit Paged="TRUE">30</RowLimit>
<Aggregations Value="Off"/>
<Toolbar Type="Freeform"/>
</View>
</XmlDefinition>
</WebPartPages:XsltListViewWebPart>
<GS:CamlQueryPdvFilter runat="server" id="CamlQueryPdvFilter1" ColumnFilterInternalName="Title"></GS:CamlQueryPdvFilter>
How can I resolve this?